diff --git a/src/org/kde/kdeconnect/Helpers/ContactsHelper.java b/src/org/kde/kdeconnect/Helpers/ContactsHelper.java index 4fd51b6a..ed8950cf 100644 --- a/src/org/kde/kdeconnect/Helpers/ContactsHelper.java +++ b/src/org/kde/kdeconnect/Helpers/ContactsHelper.java @@ -152,10 +152,10 @@ public class ContactsHelper { try (InputStream input = context.getContentResolver().openInputStream(vcardURI)) { if (input == null) { - throw new NullPointerException("ContentResolver did not give us a stream for the VCard for uID " + ID); + Log.w("Contacts", "ContentResolver did not give us a stream for the VCard for uID " + ID); + continue; } - final List lines = IOUtils.readLines(input, Charsets.UTF_8); - toReturn.put(ID, new VCardBuilder(StringUtils.join(lines, '\n'))); + toReturn.put(ID, new VCardBuilder(IOUtils.toString(input, Charsets.UTF_8))); } catch (Exception e) { // If you are experiencing this, please open a bug report indicating how you got here Log.e("Contacts", "Exception while fetching vcards", e);