Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@SUPERCILEX
Copy link
Collaborator

@samtstern Well I dunno exactly where the error is coming from, but this fixes some ugliness we had with credential saving and should fix #1239 as a side effect.

@SUPERCILEX SUPERCILEX requested a review from samtstern as a code owner April 4, 2018 22:08
@samtstern samtstern added this to the 3.3.1 milestone Apr 4, 2018
Signed-off-by: Alex Saveau <[email protected]>
}

private void handleResponse(@NonNull IdpResponse response) {
if (!response.isSuccessful()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we simplify this if statement? It's kinda melting my brain.

if (AuthUI.SOCIAL_PROVIDERS.contains(response.getProviderType())) {
  handler.startSignIn(response)
} else if (response.isSuccessful()) {
  finish(RESULT_OK, response.toIntent();
} else {
  finish(RESULT_CANCELED, response.toIntent());
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately not, your thing will crash. The only reason I have the successful check is because the providerId will be null if it's a failure. Other ideas? (I agree that the statement is confusing, but that nullability is biting us in the behind.)

Signed-off-by: Alex Saveau <[email protected]>
@SUPERCILEX SUPERCILEX changed the title Fix NPE when returning from anti-social providers Eliminate unnecessary starting of credential save activity for anti-social providers Apr 12, 2018
@SUPERCILEX
Copy link
Collaborator Author

@samtstern changed the purpose and addressed your feedback, what do you think?

@samtstern
Copy link
Contributor

LGTM!

@samtstern samtstern merged commit fa5cb40 into firebase:version-3.3.1-dev Apr 13, 2018
@SUPERCILEX SUPERCILEX deleted the npe branch April 13, 2018 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants