diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceCommunicationService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceCommunicationService.java index f3b8c58b..0eddd504 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceCommunicationService.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceCommunicationService.java @@ -479,15 +479,12 @@ public class DeviceCommunicationService extends Service { Cursor contactLookup = null; try { contactLookup = contentResolver.query(uri, null, null, null, null); - } catch (SecurityException e) { - return name; - } - - try { if (contactLookup != null && contactLookup.getCount() > 0) { contactLookup.moveToNext(); name = contactLookup.getString(contactLookup.getColumnIndex(ContactsContract.Data.DISPLAY_NAME)); } + } catch (SecurityException e) { + // ignore, just return name below } finally { if (contactLookup != null) { contactLookup.close();