Skip to content

Commit 21f8388

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

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
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)