From e7830d8e3f576c266dfddd0ca648885b28c930cd Mon Sep 17 00:00:00 2001 From: everhardt Date: Fri, 5 Nov 2021 21:20:15 +0100 Subject: [PATCH] Fixed crash on iOS scroll with empty article list --- iOS/MasterTimeline/MasterTimelineViewController.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iOS/MasterTimeline/MasterTimelineViewController.swift b/iOS/MasterTimeline/MasterTimelineViewController.swift index 4b05cea59..5e2212b0b 100644 --- a/iOS/MasterTimeline/MasterTimelineViewController.swift +++ b/iOS/MasterTimeline/MasterTimelineViewController.swift @@ -545,7 +545,8 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner } // Mark articles scrolled out of sight at the top as read - guard let firstVisibleRowIndexPath = tableView.indexPathsForVisibleRows?[0] else { return } + guard let visibleRowIndexPaths = tableView.indexPathsForVisibleRows, visibleRowIndexPaths.count > 0 else { return } + let firstVisibleRowIndexPath = visibleRowIndexPaths[0] guard let firstVisibleArticle = dataSource.itemIdentifier(for: firstVisibleRowIndexPath) else { return