From 512e0e90532ad22b5d30e6ee9e3db402af5f0bf2 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Thu, 30 Jun 2022 16:28:00 -0700 Subject: [PATCH] Fix passing invalid points to CoreGraphics when building trend history graph --- Tusker/Views/TrendHistoryView.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Tusker/Views/TrendHistoryView.swift b/Tusker/Views/TrendHistoryView.swift index 96c20a0f..00a0c845 100644 --- a/Tusker/Views/TrendHistoryView.swift +++ b/Tusker/Views/TrendHistoryView.swift @@ -42,7 +42,10 @@ class TrendHistoryView: UIView { private func createLayers() { guard let history = history, - history.count >= 2 else { return } + history.count >= 2, + !bounds.isEmpty else { + return + } let maxUses = history.max(by: { $0.uses < $1.uses })!.uses