Check for null connection.