Hello,
I got a NullPointerException in davdroid while parsing an ics with a VJOURNAL entry.
The logcat output is:
29150 E/AndroidRuntime(20206): FATAL EXCEPTION: SyncAdapterThread-1
29151 E/AndroidRuntime(20206): java.lang.NullPointerException
29152 E/AndroidRuntime(20206): at at.bitfire.davdroid.resource.Event.hasNoTime(Event.java:299)
29153 E/AndroidRuntime(20206): at at.bitfire.davdroid.resource.Event.isAllDay(Event.java:286)
29154 E/AndroidRuntime(20206): at at.bitfire.davdroid.resource.LocalCalendar.buildEntry(LocalCalendar.java:407)
29155 E/AndroidRuntime(20206): at at.bitfire.davdroid.resource.LocalCollection.add(LocalCollection.java:162)
29156 E/AndroidRuntime(20206): at at.bitfire.davdroid.syncadapter.SyncManager.synchronize(SyncManager.java:143)
29157 E/AndroidRuntime(20206): at at.bitfire.davdroid.syncadapter.DavSyncAdapter.onPerformSync(DavSyncAdapter.java:70)
29158 E/AndroidRuntime(20206): at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:254)
The ics is
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//ownCloud//NONSGML Journal 0.3.2//EN
BEGIN:VJOURNAL
DTSTART;VALUE=DATE-TIME;TZID=UTC:20130706T193511
CREATED;VALUE=DATE-TIME:20130706T193511Z
UID:4fe473a2d0
ORGANIZER:MAILTO:XXX@XXX.XXX
SUMMARY:XXX
LAST-MODIFIED;VALUE=DATE-TIME:20130706T193526Z
DTSTAMP;VALUE=DATE-TIME:20130706T193526Z
DESCRIPTION:XXX\n\nXXX\n\n
END:VJOURNAL
END:VCALENDAR
As a fix you could throw a ParseException so the VJOURNAL will not get parsed.
at/bitfire/davdroid/resource/Event.java:120
// event
ComponentList events = ical.getComponents(Component.VEVENT);
if (events == null || events.isEmpty())
{
throw new ParseException("",0);
}
I don’t have tested this, cause I don’t get the source compiled.
Thank you for this greate app