Skip to content

Commit

Permalink
Prevent NullPointerException if application activity is singleTop and…
Browse files Browse the repository at this point in the history
… minimized/restored from launcher icon. (#108)

In that case activity is reused and intent.getExtras() returns null.
  • Loading branch information
radev authored and Libin Lu committed Sep 20, 2016
1 parent e03ef47 commit 737f850
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public void onActivityResult(Activity activity, int requestCode, int resultCode,
@Override
public void onNewIntent(Intent intent){
Bundle bundle = intent.getExtras();
Boolean isLocalNotification = bundle.getBoolean("localNotification", false);
Boolean isLocalNotification = bundle != null && bundle.getBoolean("localNotification", false);
sendEvent(isLocalNotification ? "FCMLocalNotificationReceived" : "FCMNotificationReceived", parseIntent(intent));
}
}

0 comments on commit 737f850

Please sign in to comment.