[android] Protect against issue #102

This commit is contained in:
Chris Bianca 2017-05-10 20:49:00 +01:00
parent c4f8688348
commit dd0bf2219e
1 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,7 @@
package io.invertase.firebase;
import android.app.Activity;
import java.util.Map;
import java.util.HashMap;
@ -34,7 +36,10 @@ public class RNFirebaseModule extends ReactContextBaseJavaModule implements Life
int status = gapi.isGooglePlayServicesAvailable(getReactApplicationContext());
if (status != ConnectionResult.SUCCESS && gapi.isUserResolvableError(status)) {
gapi.getErrorDialog(getCurrentActivity(), status, 2404).show();
Activity activity = getCurrentActivity();
if (activity != null) {
gapi.getErrorDialog(activity, status, 2404).show();
}
}
}