Protects against null contact lists

pull/606/head
Vitor Pamplona 2023-09-20 16:32:38 -04:00
rodzic 909d3f4fbe
commit 3e6aa2b943
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -352,7 +352,11 @@ object LocalPreferences {
val latestContactList = try {
getString(PrefKeys.LATEST_CONTACT_LIST, null)?.let {
println("Decoding Contact List: " + it)
Event.fromJson(it) as ContactListEvent?
if (it != null) {
Event.fromJson(it) as ContactListEvent?
} else {
null
}
}
} catch (e: Throwable) {
Log.w("LocalPreferences", "Error Decoding Contact List ${getString(PrefKeys.LATEST_CONTACT_LIST, null)}", e)