Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {

@MainThread
private void handleSignInResponse(int resultCode, Intent data) {
IdpResponse response = data != null ? IdpResponse.fromResultIntent(data) : null;
IdpResponse response = IdpResponse.fromResultIntent(data);

// Successfully signed in
if (resultCode == ResultCodes.OK) {
Expand Down
2 changes: 1 addition & 1 deletion auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ the user to sign in again later, or proceed with anonymous sign-in if supported.
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RC_SIGN_IN) {
IdpResponse response = data != null ? IdpResponse.fromResultIntent(data) : null;
IdpResponse response = IdpResponse.fromResultIntent(data);

// Successfully signed in
if (resultCode == ResultCodes.OK) {
Expand Down
6 changes: 5 additions & 1 deletion auth/src/main/java/com/firebase/ui/auth/IdpResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ public void writeToParcel(Parcel dest, int flags) {
*/
@Nullable
public static IdpResponse fromResultIntent(Intent resultIntent) {
return resultIntent.getParcelableExtra(ExtraConstants.EXTRA_IDP_RESPONSE);
if (resultIntent != null) {
return resultIntent.getParcelableExtra(ExtraConstants.EXTRA_IDP_RESPONSE);
} else {
return null;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since fromResultIntent is annotated as @Nullable, I think this was the original intention.

}

public static Intent getIntent(IdpResponse response) {
Expand Down