From 5d0d6957074c448a675f51e15424d210c27456b6 Mon Sep 17 00:00:00 2001 From: Philippe Converset Date: Mon, 26 May 2014 16:15:08 +0200 Subject: [PATCH] Avoid crash on selection if view is empty. --- Deck/PhotoStackView.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Deck/PhotoStackView.m b/Deck/PhotoStackView.m index 703359a..dbd0aa6 100644 --- a/Deck/PhotoStackView.m +++ b/Deck/PhotoStackView.m @@ -305,6 +305,8 @@ -(NSUInteger)indexOfTopPhoto { } -(UIView *)topPhoto { + if(self.subviews.count == 0) + return nil; return [self.subviews objectAtIndex:[self.subviews count]-1]; }