From 75ed407a25c7a14fcacd11faeefb49fba2f64565 Mon Sep 17 00:00:00 2001 From: iKirby <6316115+iKirby@users.noreply.github.com> Date: Wed, 27 Nov 2024 10:40:34 +0800 Subject: [PATCH] Fix possible crash --- .../main/java/io/nekohasekai/sfa/ui/main/DashboardFragment.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/nekohasekai/sfa/ui/main/DashboardFragment.kt b/app/src/main/java/io/nekohasekai/sfa/ui/main/DashboardFragment.kt index 8dde378..7258678 100644 --- a/app/src/main/java/io/nekohasekai/sfa/ui/main/DashboardFragment.kt +++ b/app/src/main/java/io/nekohasekai/sfa/ui/main/DashboardFragment.kt @@ -120,7 +120,9 @@ class DashboardFragment : Fragment(R.layout.fragment_dashboard) { } } }.onFailure { - activity?.errorDialogBuilder(it)?.show() + withContext(Dispatchers.Main) { + activity?.errorDialogBuilder(it)?.show() + } } } }