From 3fe31ccafb32ab84e394a64874ad22ac146de587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Garci=CC=81a=20S?= Date: Tue, 30 Apr 2013 12:21:16 -0400 Subject: [PATCH] Fixes a case when animationDidStop: is called and nextView has already set to nil. --- CubeFlip/RSCubeView.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CubeFlip/RSCubeView.m b/CubeFlip/RSCubeView.m index b6a7078..8333845 100644 --- a/CubeFlip/RSCubeView.m +++ b/CubeFlip/RSCubeView.m @@ -292,7 +292,10 @@ - (void)animationDidStart:(CAAnimation *)animation { - (void)animationDidStop:(CAAnimation *)animation finished:(BOOL)finished { - isAnimating = NO; + if (!isAnimating) + return; + + isAnimating = NO; self.contentView = nextView; [animationLayer removeFromSuperlayer];