Loading src/main/java/at/bitfire/ical4android/AndroidEvent.kt +7 −5 Original line number Diff line number Diff line Loading @@ -110,13 +110,15 @@ abstract class AndroidEvent( field = event val e = iterEvents.next() populateEvent(e.entityValues) populateEvent(MiscUtils.removeEmptyStrings(e.entityValues)) for (subValue in e.subValues) for (subValue in e.subValues) { val subValues = MiscUtils.removeEmptyStrings(subValue.values) when (subValue.uri) { Attendees.CONTENT_URI -> populateAttendee(subValue.values) Reminders.CONTENT_URI -> populateReminder(subValue.values) ExtendedProperties.CONTENT_URI -> populateExtended(subValue.values) Attendees.CONTENT_URI -> populateAttendee(subValues) Reminders.CONTENT_URI -> populateReminder(subValues) ExtendedProperties.CONTENT_URI -> populateExtended(subValues) } } populateExceptions() Loading src/main/java/at/bitfire/ical4android/MiscUtils.kt +4 −2 Original line number Diff line number Diff line Loading @@ -85,15 +85,17 @@ object MiscUtils { /** * Removes empty [String] values from [values]. * * @param values set of values to be processed * @param values set of values to be modified * @return the modified object (which is the same object as passed in; for chaining) */ fun removeEmptyStrings(values: ContentValues) { fun removeEmptyStrings(values: ContentValues): ContentValues { val it = values.keySet().iterator() while (it.hasNext()) { val obj = values[it.next()] if (obj is String && obj.isEmpty()) it.remove() } return values } Loading Loading
src/main/java/at/bitfire/ical4android/AndroidEvent.kt +7 −5 Original line number Diff line number Diff line Loading @@ -110,13 +110,15 @@ abstract class AndroidEvent( field = event val e = iterEvents.next() populateEvent(e.entityValues) populateEvent(MiscUtils.removeEmptyStrings(e.entityValues)) for (subValue in e.subValues) for (subValue in e.subValues) { val subValues = MiscUtils.removeEmptyStrings(subValue.values) when (subValue.uri) { Attendees.CONTENT_URI -> populateAttendee(subValue.values) Reminders.CONTENT_URI -> populateReminder(subValue.values) ExtendedProperties.CONTENT_URI -> populateExtended(subValue.values) Attendees.CONTENT_URI -> populateAttendee(subValues) Reminders.CONTENT_URI -> populateReminder(subValues) ExtendedProperties.CONTENT_URI -> populateExtended(subValues) } } populateExceptions() Loading
src/main/java/at/bitfire/ical4android/MiscUtils.kt +4 −2 Original line number Diff line number Diff line Loading @@ -85,15 +85,17 @@ object MiscUtils { /** * Removes empty [String] values from [values]. * * @param values set of values to be processed * @param values set of values to be modified * @return the modified object (which is the same object as passed in; for chaining) */ fun removeEmptyStrings(values: ContentValues) { fun removeEmptyStrings(values: ContentValues): ContentValues { val it = values.keySet().iterator() while (it.hasNext()) { val obj = values[it.next()] if (obj is String && obj.isEmpty()) it.remove() } return values } Loading