catch and report errors thrown at obtaining phone numbers and emails

This commit is contained in:
tibbi 2018-01-23 21:15:23 +01:00
parent 71d40b0e08
commit 2606456255
1 changed files with 5 additions and 0 deletions

View File

@ -117,6 +117,8 @@ class ContactsHelper(val activity: BaseSimpleActivity) {
phoneNumbers[id].add(phoneNumber)
} while (cursor.moveToNext())
}
} catch (e: Exception) {
activity.showErrorToast(e)
} finally {
cursor?.close()
}
@ -151,6 +153,9 @@ class ContactsHelper(val activity: BaseSimpleActivity) {
emails[id]!!.add(Email(email, type))
} while (cursor.moveToNext())
}
} catch (e: Exception) {
activity.showErrorToast(e)
} finally {
cursor?.close()
}