Generic error handling
Fix null pointer on re-authentication.