Check for null prior to accessing inetAddress.