Catch exceptions related to AppWidgetHost.stopListening

This commit is contained in:
MM20 2023-05-08 17:26:07 +02:00
parent 95ad871c68
commit b5a4d459d3
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -34,6 +34,7 @@ import androidx.compose.ui.unit.dp
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.repeatOnLifecycle
import androidx.lifecycle.viewmodel.compose.viewModel
import de.mm20.launcher2.crashreporter.CrashReporter
import de.mm20.launcher2.ui.R
import de.mm20.launcher2.ui.ktx.animateTo
import de.mm20.launcher2.ui.launcher.sheets.LocalBottomSheetManager
@ -63,7 +64,11 @@ fun WidgetColumn(
try {
awaitCancellation()
} finally {
widgetHost.stopListening()
try {
widgetHost.stopListening()
} catch (e: Exception) {
CrashReporter.logException(e)
}
}
}
}