From d0570d16a854e98cb72aa703a1cc3df830194478 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Fri, 6 Sep 2019 10:38:02 -0500 Subject: [PATCH] Prevent attempt to restore article selection when there are no articles --- iOS/MasterTimeline/MasterTimelineViewController.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iOS/MasterTimeline/MasterTimelineViewController.swift b/iOS/MasterTimeline/MasterTimelineViewController.swift index 48cfcaeed..bfa04de25 100644 --- a/iOS/MasterTimeline/MasterTimelineViewController.swift +++ b/iOS/MasterTimeline/MasterTimelineViewController.swift @@ -156,6 +156,8 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner } func updateArticleSelection(animate: Bool) { + guard !coordinator.articles.isEmpty else { return } + if let indexPath = coordinator.currentArticleIndexPath { if tableView.indexPathForSelectedRow != indexPath { tableView.selectRow(at: indexPath, animated: animate, scrollPosition: .middle) @@ -163,6 +165,7 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner } else { tableView.selectRow(at: nil, animated: animate, scrollPosition: .none) } + updateUI() }