Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid NPE when missing DTSTART for recurring events #1336

Draft
wants to merge 4 commits into
base: main-ose
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,14 @@ class JtxSyncManager @AssistedInject constructor(

icalobjects.forEach { jtxICalObject ->
// if the entry is a recurring entry (and therefore has a recurid)
// we udpate the existing (generated) entry
// we update the existing (generated) entry
if(jtxICalObject.recurid != null) {
val local = localCollection.findRecurring(jtxICalObject.uid, jtxICalObject.recurid!!, jtxICalObject.dtstart!!)
val local = jtxICalObject.dtstart?.let { dtstart ->
localCollection.findRecurring(jtxICalObject.uid, jtxICalObject.recurid!!, dtstart)
} ?: run {
logger.log(Level.INFO, "Got a recur instance (${jtxICalObject.recurid}/${jtxICalObject.uid}) with an invalid dtstart.")
null
}
SyncException.wrapWithLocalResource(local) {
logger.log(Level.INFO, "Updating $fileName with recur instance ${jtxICalObject.recurid} in local list", jtxICalObject)
if(local != null) {
Expand Down