From e2de38647a916f74c8ae16144fa4d785a01f6535 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sun, 9 Aug 2020 20:13:37 -0500 Subject: [PATCH] Don't crash on early calls to update the toolbar --- iOS/MasterTimeline/MasterTimelineViewController.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iOS/MasterTimeline/MasterTimelineViewController.swift b/iOS/MasterTimeline/MasterTimelineViewController.swift index 48b092179..5eefb9561 100644 --- a/iOS/MasterTimeline/MasterTimelineViewController.swift +++ b/iOS/MasterTimeline/MasterTimelineViewController.swift @@ -626,8 +626,11 @@ private extension MasterTimelineViewController { } func updateToolbar() { + guard firstUnreadButton != nil else { return } + markAllAsReadButton.isEnabled = coordinator.isTimelineUnreadAvailable firstUnreadButton.isEnabled = coordinator.isTimelineUnreadAvailable + if coordinator.isRootSplitCollapsed { if let toolbarItems = toolbarItems, toolbarItems.last != firstUnreadButton { var items = toolbarItems