From dd0bf2219e43989cd35eecccc1a3799e5f5fddcc Mon Sep 17 00:00:00 2001 From: Chris Bianca Date: Wed, 10 May 2017 20:49:00 +0100 Subject: [PATCH] [android] Protect against issue #102 --- .../main/java/io/invertase/firebase/RNFirebaseModule.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/io/invertase/firebase/RNFirebaseModule.java b/android/src/main/java/io/invertase/firebase/RNFirebaseModule.java index 3b910672..e32bcc56 100644 --- a/android/src/main/java/io/invertase/firebase/RNFirebaseModule.java +++ b/android/src/main/java/io/invertase/firebase/RNFirebaseModule.java @@ -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(); + } } }