From a5db589b6df5f4d0455637887c77a5d9d6bf0b49 Mon Sep 17 00:00:00 2001 From: Roberto Dias Date: Mon, 28 Dec 2020 14:30:10 +0000 Subject: [PATCH] fix(Division by Zero): #320 - guard division by 0 --- Source/Infra/EKContentView.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Infra/EKContentView.swift b/Source/Infra/EKContentView.swift index d609effc..ba3bd520 100644 --- a/Source/Infra/EKContentView.swift +++ b/Source/Infra/EKContentView.swift @@ -669,6 +669,7 @@ extension EKContentView { } private func calculateLogarithmicOffset(forOffset offset: CGFloat, currentTranslation: CGFloat) { + guard verticalLimit != 0 else { return } if attributes.position.isTop { inConstraint.constant = verticalLimit * (1 + log10(offset / verticalLimit)) } else {