diff --git a/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalCalendarImportFragment.kt b/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalCalendarImportFragment.kt index 982d42de..4179af1e 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalCalendarImportFragment.kt +++ b/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalCalendarImportFragment.kt @@ -189,7 +189,9 @@ class LocalCalendarImportFragment : ListFragment() { } override fun onPostExecute(result: ResultFragment.ImportResult) { - progressDialog.dismiss() + if (progressDialog.isShowing && !activity!!.isDestroyed) { + progressDialog.dismiss() + } (activity as ResultFragment.OnImportCallback).onImportResult(result) } diff --git a/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalContactImportFragment.kt b/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalContactImportFragment.kt index 8b16177f..17e5e9b1 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalContactImportFragment.kt +++ b/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalContactImportFragment.kt @@ -124,7 +124,9 @@ class LocalContactImportFragment : Fragment() { } override fun onPostExecute(result: ResultFragment.ImportResult) { - progressDialog.dismiss() + if (progressDialog.isShowing && !activity!!.isDestroyed) { + progressDialog.dismiss() + } (activity as ResultFragment.OnImportCallback).onImportResult(result) }