From 82cd3f1eb1b4b0774608e2a0064d5d1068a3874c Mon Sep 17 00:00:00 2001 From: manu Date: Fri, 14 Jun 2024 09:26:55 +0200 Subject: [PATCH] fix: [ANDROAPP-6184] crash on delete data dialog callback --- .../org/dhis2/usescases/settings/SyncManagerFragment.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/dhis2/usescases/settings/SyncManagerFragment.java b/app/src/main/java/org/dhis2/usescases/settings/SyncManagerFragment.java index 01123525d9..d08a0b7c1e 100644 --- a/app/src/main/java/org/dhis2/usescases/settings/SyncManagerFragment.java +++ b/app/src/main/java/org/dhis2/usescases/settings/SyncManagerFragment.java @@ -292,8 +292,10 @@ public void deleteLocalData() { getString(R.string.action_accept), true, () -> { - analyticsHelper().setEvent(CONFIRM_DELETE_LOCAL_DATA, CLICK, CONFIRM_DELETE_LOCAL_DATA); - presenter.deleteLocalData(); + if (deleteLocalDataDialog.isAdded()) { + analyticsHelper().setEvent(CONFIRM_DELETE_LOCAL_DATA, CLICK, CONFIRM_DELETE_LOCAL_DATA); + presenter.deleteLocalData(); + } return null; }) );