From 2606456255f99576f21cea53426b107297d64897 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 23 Jan 2018 21:15:23 +0100 Subject: [PATCH] catch and report errors thrown at obtaining phone numbers and emails --- .../com/simplemobiletools/contacts/helpers/ContactsHelper.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/ContactsHelper.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/ContactsHelper.kt index 9687776f..af03044a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/ContactsHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/helpers/ContactsHelper.kt @@ -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() }