From 41505347e0f985410dbcd966ca95bf52ebc35263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manu=20Mu=C3=B1oz?= Date: Tue, 18 Jun 2024 09:44:54 +0200 Subject: [PATCH] fix: [ANDROAPP-6184] crash on delete data dialog callback (#3687) --- .../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; }) );