From 2bc03f820b036bb3b70bd22f1ba5d4aa049d8291 Mon Sep 17 00:00:00 2001 From: Abhishek Banthia <8280282+n0shake@users.noreply.github.com> Date: Tue, 19 Apr 2022 22:08:13 -0400 Subject: [PATCH] Make upcoming events source optional. --- Clocker/Panel/ParentPanelController.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Clocker/Panel/ParentPanelController.swift b/Clocker/Panel/ParentPanelController.swift index 05b8324..b2d621a 100644 --- a/Clocker/Panel/ParentPanelController.swift +++ b/Clocker/Panel/ParentPanelController.swift @@ -89,7 +89,7 @@ class ParentPanelController: NSWindowController { // Upcoming Events @IBOutlet var upcomingEventCollectionView: NSCollectionView! @IBOutlet var upcomingEventContainerView: NSView! - public var upcomingEventsDataSource: UpcomingEventsDataSource! + public var upcomingEventsDataSource: UpcomingEventsDataSource? var defaultPreferences: [Data] { return DataStore.shared().timezones() @@ -829,7 +829,7 @@ class ParentPanelController: NSWindowController { if self.upcomingEventCollectionView != nil, let upcomingEvents = eventCenter.upcomingEventsForDay(events) { - self.upcomingEventsDataSource.updateEventsDataSource(upcomingEvents) + self.upcomingEventsDataSource?.updateEventsDataSource(upcomingEvents) self.upcomingEventCollectionView.reloadData() return } @@ -840,7 +840,7 @@ class ParentPanelController: NSWindowController { } } else { if upcomingEventCollectionView != nil { - upcomingEventsDataSource.updateEventsDataSource([]) + upcomingEventsDataSource?.updateEventsDataSource([]) upcomingEventCollectionView.reloadData() return }