Skip to content

Commit 21f8388

Browse files
NickToropovalexandergoncharov-zz
authored andcommitted
Fixed app crash caused by BadTokenException. (#1287)
1 parent 163e2b5 commit 21f8388

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

android/app/src/main/java/com/microsoft/codepush/react/CodePushDialog.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public CodePushDialog(ReactApplicationContext reactContext) {
2020
public void showDialog(final String title, final String message, final String button1Text,
2121
final String button2Text, final Callback successCallback, Callback errorCallback) {
2222
Activity currentActivity = getCurrentActivity();
23-
if (currentActivity == null) {
23+
if (currentActivity == null || currentActivity.isFinishing()) {
2424
// If getCurrentActivity is null, it could be because the app is backgrounded,
2525
// so we show the dialog when the app resumes)
2626
getReactApplicationContext().addLifecycleEventListener(new LifecycleEventListener() {

0 commit comments

Comments
 (0)