From f437fe9157f0fddcf3c8b922639d26e29c899e0d Mon Sep 17 00:00:00 2001 From: Joseph Mattello Date: Thu, 5 May 2022 03:16:02 -0400 Subject: [PATCH] Fixes #735 check 0 divide, use TimeInt.zero over 0 Signed-off-by: Joseph Mattello --- Sources/Animator/HeroViewPropertyViewContext.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/Animator/HeroViewPropertyViewContext.swift b/Sources/Animator/HeroViewPropertyViewContext.swift index 11e56596..5dcbdd63 100644 --- a/Sources/Animator/HeroViewPropertyViewContext.swift +++ b/Sources/Animator/HeroViewPropertyViewContext.swift @@ -36,7 +36,8 @@ internal class HeroViewPropertyViewContext: HeroAnimatorViewContext { } override func resume(timePassed: TimeInterval, reverse: Bool) -> TimeInterval { - guard let visualEffectView = snapshot as? UIVisualEffectView else { return 0 } + guard let visualEffectView = snapshot as? UIVisualEffectView else { return .zero } + guard duration > 0 else { return .zero } if reverse { viewPropertyAnimator?.stopAnimation(false) viewPropertyAnimator?.finishAnimation(at: .current)