Commit 504a674b authored by Libin Lu's avatar Libin Lu Committed by GitHub

fix null issue

parent ca7143a4
......@@ -58,12 +58,16 @@ public class FIRMessagingModule extends ReactContextBaseJavaModule implements Li
@ReactMethod
public void getInitialNotification(Promise promise){
Activity activity = getCurrentActivity();
if(activity == null){
promise.resolve(null);
return;
}
Intent intent = activity.getIntent();
if(activity == null || (intent.getAction() != null && intent.getAction().equals("android.intent.action.MAIN"))){
if(intent.getAction() != null && intent.getAction().equals("android.intent.action.MAIN")){
promise.resolve(null);
return;
}
promise.resolve(parseIntent(activity.getIntent()));
promise.resolve(parseIntent(intent));
}
@ReactMethod
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment