Fixed crash on iOS scroll with empty article list

This commit is contained in:
everhardt 2021-11-05 21:20:15 +01:00
parent 96ffa3aa22
commit e7830d8e3f
1 changed files with 2 additions and 1 deletions

View File

@ -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