Skip to content

Commit

Permalink
Don't break trashbin if calendar is undefined
Browse files Browse the repository at this point in the history
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
  • Loading branch information
raimund-schluessler committed Dec 4, 2021
1 parent 217b670 commit de65039
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/AppNavigation/Trashbin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export default {
} catch (e) {
// ignore
}
let subline = vobject.calendar.displayName
let subline = vobject.calendar?.displayName || t('tasks', 'Unknown calendar')
if (vobject.isEvent) {
const event = vobject?.calendarComponent.getFirstComponent('VEVENT')
if (event?.startDate.jsDate && event?.isAllDay()) {
Expand All @@ -168,8 +168,8 @@ export default {
}
}
const color = vobject.calendarComponent.getComponentIterator().next().value?.color
?? vobject.calendar.color
?? uidToHexColor(vobject.calendar.displayName)
?? vobject.calendar?.color
?? uidToHexColor(subline)
return {
vobject,
type: 'object',
Expand Down

0 comments on commit de65039

Please sign in to comment.