Merge pull request #3338 from everhardt/feat-1844-scroll-mark-as-read

Fixed crash on iOS scroll with empty article list in mark-as-read-on-scroll
This commit is contained in:
Maurice Parker 2021-11-05 16:22:48 -05:00 committed by GitHub
commit 50a61d6a67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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