From a3443b2f6d53e82eb2cf19a2b2e2f8765aa59fca Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 20 Jan 2025 22:48:21 -0800 Subject: [PATCH] Fix crashing bug in Starred widget. --- Widget/Widget Views/StarredWidget.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Widget/Widget Views/StarredWidget.swift b/Widget/Widget Views/StarredWidget.swift index 602c11307..788aed462 100644 --- a/Widget/Widget Views/StarredWidget.swift +++ b/Widget/Widget Views/StarredWidget.swift @@ -78,10 +78,11 @@ struct StarredWidgetView : View { reduceAccessibilityCount = 1 } + let starredCount = entry.widgetData.starredArticles.count if family == .systemLarge { - return entry.widgetData.currentStarredCount >= 7 ? (7 - reduceAccessibilityCount) : entry.widgetData.currentStarredCount + return starredCount >= 7 ? (7 - reduceAccessibilityCount) : starredCount } - return entry.widgetData.currentStarredCount >= 3 ? (3 - reduceAccessibilityCount) : entry.widgetData.currentStarredCount + return starredCount >= 3 ? (3 - reduceAccessibilityCount) : starredCount } var inboxZero: some View {