mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Catching another exception in ContactsLoader + prevent crash if cursor is null
This commit is contained in:
parent
8174eb6ceb
commit
c3c1ba90d3
1 changed files with 8 additions and 1 deletions
|
|
@ -71,7 +71,11 @@ class ContactLoader : LoaderManager.LoaderCallbacks<Cursor> {
|
|||
)
|
||||
}
|
||||
|
||||
override fun onLoadFinished(loader: Loader<Cursor>, cursor: Cursor) {
|
||||
override fun onLoadFinished(loader: Loader<Cursor>, cursor: Cursor?) {
|
||||
if (cursor == null) {
|
||||
Log.e("[Contacts Loader] Cursor is null!")
|
||||
return
|
||||
}
|
||||
Log.i("[Contacts Loader] Load finished, found ${cursor.count} entries in cursor")
|
||||
|
||||
val core = coreContext.core
|
||||
|
|
@ -211,6 +215,9 @@ class ContactLoader : LoaderManager.LoaderCallbacks<Cursor> {
|
|||
}
|
||||
} catch (sde: StaleDataException) {
|
||||
Log.e("[Contacts Loader] State Data Exception: $sde")
|
||||
} catch (ise: IllegalStateException) {
|
||||
Log.e("[Contacts Loader] Illegal State Exception: $ise")
|
||||
} finally {
|
||||
cancel()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue