Checks for a nil response before attempting to get the response-code.