Permalink
Browse files

Fix logic for returning [NSNull null] in -[TUIView actionForLayer:for…

…Key:] (we should not be returning nil)
  • Loading branch information...
1 parent 7c284e8 commit d29f6b04f2bc53da56f34926ae122d3220caa1a9 @jspahrsummers jspahrsummers committed Jul 18, 2012
Showing with 8 additions and 3 deletions.
  1. +8 −3 lib/UIKit/TUIView+Animation.m
@@ -288,13 +288,18 @@ - (void)removeAllAnimations
- (id<CAAction>)actionForLayer:(CALayer *)layer forKey:(NSString *)event
{
- if(disableAnimations == YES)
- return (id)[NSNull null];
+ id defaultAction = [NSNull null];
+
+ if(disableAnimations)
+ return defaultAction;
if((animateContents == NO) && [event isEqualToString:@"contents"])
- return (id<CAAction>)[NSNull null]; // default - don't animate contents
+ return defaultAction; // default - don't animate contents
id animation = [TUIView _currentAnimation];
+ if (!animation)
+ return defaultAction;
+
if ([TUICAAction interceptsActionForKey:event])
return [TUICAAction actionWithAction:animation];
else

0 comments on commit d29f6b0

Please sign in to comment.