Skip to content

Commit 90efc3d

Browse files
committed
Fixes the crash when the user opens the app while offline
1 parent 4937825 commit 90efc3d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Diff for: android/src/main/java/io/fullstack/firestack/FirestackAuth.java

+10-1
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,16 @@ public void userExceptionCallback(Exception exp, final Callback onFail) {
598598
Log.e(TAG, ex.getMessage());
599599
}
600600

601-
onFail.invoke(error);
601+
try {
602+
onFail.invoke(error);
603+
} catch (RuntimeException ex) {
604+
// Firebase tries to login 3 times, so the callback might
605+
// be called as much as that. This will prevent a crash in case
606+
// the callback throws the following error:
607+
// java.lang.RuntimeException: Illegal callback invocation from native module. This callback type only permits a single invocation from native code.
608+
Log.e(TAG, ex.getMessage());
609+
}
610+
602611
}
603612

604613
private WritableMap getUserMap() {

0 commit comments

Comments
 (0)