From cdffda559305785d2a463ae28512514680aa3428 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Wed, 20 Jan 2021 18:41:24 -0500 Subject: [PATCH] Fix crash when profile screen disappears --- .../Screens/Utilities/TimelineLikeTableViewController.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tusker/Screens/Utilities/TimelineLikeTableViewController.swift b/Tusker/Screens/Utilities/TimelineLikeTableViewController.swift index 65f9c57b..1cfa7fdd 100644 --- a/Tusker/Screens/Utilities/TimelineLikeTableViewController.swift +++ b/Tusker/Screens/Utilities/TimelineLikeTableViewController.swift @@ -117,7 +117,9 @@ class TimelineLikeTableViewController: EnhancedTableViewController, Refres } private func pruneOffscreenRows() { - guard let lastVisibleRow = lastLastVisibleRow else { + guard let lastVisibleRow = lastLastVisibleRow, + // never remove the last section + sections.count - headerSectionsCount() > 1 else { return } let lastSectionIndex = sections.count - 1