Skip to content

Commit a5595b5

Browse files
author
Kholiavko
committed
FIX: Fatal Exception: java.lang.IllegalArgumentException in com.showlocationservicesdialogbox.LocationServicesDialogBoxModule.forceCloseDialog
1 parent 4a899ab commit a5595b5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

android/src/main/java/com/showlocationservicesdialogbox/LocationServicesDialogBoxModule.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ public void checkLocationServicesIsEnabled(ReadableMap configMap, Promise promis
4848

4949
@ReactMethod
5050
public void forceCloseDialog() {
51-
if (alertDialog != null && promiseCallback != null) {
52-
alertDialog.cancel();
53-
}
51+
try {
52+
if (alertDialog != null && alertDialog.isShowing() && promiseCallback != null) {
53+
alertDialog.cancel();
54+
}
55+
} catch (Exception ignored) {}
5456
}
5557

5658
@ReactMethod

0 commit comments

Comments
 (0)