Fix TrendHistoryView trying to create shape layers with NaNs
This commit is contained in:
parent
18bc6ce61e
commit
ab17a688cf
|
@ -48,6 +48,9 @@ class TrendHistoryView: UIView {
|
|||
}
|
||||
|
||||
let maxUses = history.max(by: { $0.uses < $1.uses })!.uses
|
||||
guard maxUses > 0 else {
|
||||
return
|
||||
}
|
||||
|
||||
// remove old layers if this view is being re-used
|
||||
layer.sublayers?.forEach { $0.removeFromSuperlayer() }
|
||||
|
|
Loading…
Reference in New Issue