diff --git a/src/at/bitfire/davdroid/resource/Event.java b/src/at/bitfire/davdroid/resource/Event.java index 80610cd8..ab453eb1 100644 --- a/src/at/bitfire/davdroid/resource/Event.java +++ b/src/at/bitfire/davdroid/resource/Event.java @@ -122,7 +122,7 @@ public class Event extends Resource { ComponentList events = ical.getComponents(Component.VEVENT); if (events == null || events.isEmpty()) return; - VEvent event = (VEvent)events.get(0); + VEvent event = (VEvent)events.get(0); if (event.getUid() != null) uid = event.getUid().getValue(); diff --git a/src/at/bitfire/davdroid/resource/LocalAddressBook.java b/src/at/bitfire/davdroid/resource/LocalAddressBook.java index 088cdc03..94c15561 100644 --- a/src/at/bitfire/davdroid/resource/LocalAddressBook.java +++ b/src/at/bitfire/davdroid/resource/LocalAddressBook.java @@ -212,7 +212,9 @@ public class LocalAddressBook extends LocalCollection { number.addType(Contact.PHONE_TYPE_MMS); break; case Phone.TYPE_CUSTOM: - number.addType(TelephoneType.get(labelToXName(cursor.getString(1)))); + String customType = cursor.getString(1); + if (customType != null && !customType.isEmpty()) + number.addType(TelephoneType.get(labelToXName(customType))); } c.getPhoneNumbers().add(number); } @@ -234,7 +236,9 @@ public class LocalAddressBook extends LocalCollection { email.addType(Contact.EMAIL_TYPE_MOBILE); break; case Email.TYPE_CUSTOM: - email.addType(EmailType.get(labelToXName(cursor.getString(2)))); + String customType = cursor.getString(2); + if (customType != null && !customType.isEmpty()) + email.addType(EmailType.get(labelToXName(customType))); break; } c.getEmails().add(email); @@ -310,7 +314,9 @@ public class LocalAddressBook extends LocalCollection { impp.addType(ImppType.WORK); break; case Im.TYPE_CUSTOM: - impp.addType(ImppType.get(labelToXName(cursor.getString(2)))); + String customType = cursor.getString(2); + if (customType != null && !customType.isEmpty()) + impp.addType(ImppType.get(labelToXName(customType))); break; } c.getImpps().add(impp); @@ -351,7 +357,9 @@ public class LocalAddressBook extends LocalCollection { address.addType(AddressType.WORK); break; case StructuredPostal.TYPE_CUSTOM: - address.addType(AddressType.get(labelToXName(cursor.getString(2)))); + String customType = cursor.getString(2); + if (customType != null && !customType.isEmpty()) + address.addType(AddressType.get(labelToXName(customType))); break; } address.setStreetAddress(cursor.getString(3)); diff --git a/src/at/bitfire/davdroid/resource/LocalCollection.java b/src/at/bitfire/davdroid/resource/LocalCollection.java index 2ff2b3ff..d28365d4 100644 --- a/src/at/bitfire/davdroid/resource/LocalCollection.java +++ b/src/at/bitfire/davdroid/resource/LocalCollection.java @@ -100,9 +100,6 @@ public abstract class LocalCollection { LinkedList fresh = new LinkedList(); while (cursor != null && cursor.moveToNext()) { T resource = findById(cursor.getLong(0), true); - /*String uid = randomUID(), - resourceName = uid.replace("@", "_") + fileExtension(); - resource.setUid(uid);*/ resource.initialize(); // new record: set generated UID + remote file name in database diff --git a/src/at/bitfire/davdroid/webdav/WebDavResource.java b/src/at/bitfire/davdroid/webdav/WebDavResource.java index 9e323db9..d2c34c57 100644 --- a/src/at/bitfire/davdroid/webdav/WebDavResource.java +++ b/src/at/bitfire/davdroid/webdav/WebDavResource.java @@ -294,7 +294,7 @@ public class WebDavResource { multiget.prop.addressData = new DavProp.DavPropAddressData(); else if (type == MultigetType.CALENDAR) multiget.prop.calendarData = new DavProp.DavPropCalendarData(); - + multiget.hrefs = new ArrayList(names.length); for (String name : names) multiget.hrefs.add(new DavHref(location.resolve(name).getRawPath()));