Skip to content

Commit 2606456

Browse files
committed
catch and report errors thrown at obtaining phone numbers and emails
1 parent 71d40b0 commit 2606456

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/src/main/kotlin/com/simplemobiletools/contacts/helpers/ContactsHelper.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ class ContactsHelper(val activity: BaseSimpleActivity) {
117117
phoneNumbers[id].add(phoneNumber)
118118
} while (cursor.moveToNext())
119119
}
120+
} catch (e: Exception) {
121+
activity.showErrorToast(e)
120122
} finally {
121123
cursor?.close()
122124
}
@@ -151,6 +153,9 @@ class ContactsHelper(val activity: BaseSimpleActivity) {
151153
emails[id]!!.add(Email(email, type))
152154
} while (cursor.moveToNext())
153155
}
156+
157+
} catch (e: Exception) {
158+
activity.showErrorToast(e)
154159
} finally {
155160
cursor?.close()
156161
}

0 commit comments

Comments
 (0)