better null checks for BasicAuthCredentials