Skip to content

Commit 4c7c890

Browse files
committed
Added handling of null dtstart
Signed-off-by: Arnau Mora <[email protected]>
1 parent 0012dec commit 4c7c890

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/src/main/kotlin/at/bitfire/davdroid/sync/JtxSyncManager.kt

+7-2
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,14 @@ class JtxSyncManager @AssistedInject constructor(
163163

164164
icalobjects.forEach { jtxICalObject ->
165165
// if the entry is a recurring entry (and therefore has a recurid)
166-
// we udpate the existing (generated) entry
166+
// we update the existing (generated) entry
167167
if(jtxICalObject.recurid != null) {
168-
val local = localCollection.findRecurring(jtxICalObject.uid, jtxICalObject.recurid!!, jtxICalObject.dtstart!!)
168+
val local = jtxICalObject.dtstart?.let { dtstart ->
169+
localCollection.findRecurring(jtxICalObject.uid, jtxICalObject.recurid!!, dtstart)
170+
} ?: run {
171+
logger.log(Level.INFO, "Got a recur instance (${jtxICalObject.recurid}/${jtxICalObject.uid}) with an invalid dtstart.")
172+
null
173+
}
169174
SyncException.wrapWithLocalResource(local) {
170175
logger.log(Level.INFO, "Updating $fileName with recur instance ${jtxICalObject.recurid} in local list", jtxICalObject)
171176
if(local != null) {

0 commit comments

Comments
 (0)