fix: Fix application crashes caused by improper handling of coroutine exceptions (#249)

This commit is contained in:
nanLianQing
2025-07-01 23:26:36 +08:00
committed by GitHub
parent a84cf70730
commit 3729c22dd0

View File

@@ -105,7 +105,11 @@ class HomeViewModel : ViewModel() {
fun initializeData() { fun initializeData() {
viewModelScope.launch { viewModelScope.launch {
loadCachedData() try {
loadCachedData()
} catch(e: Exception) {
Log.e(TAG, "Error when reading cached data", e)
}
} }
} }