Fix passing invalid points to CoreGraphics when building trend history graph

This commit is contained in:
Shadowfacts 2022-06-30 16:28:00 -07:00
parent b842389449
commit 512e0e9053
1 changed files with 4 additions and 1 deletions

View File

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