Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[iOS] Protect animation argument missing which cause crash on iOS. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
wqyfavor authored and jianhan-he committed Aug 1, 2019
1 parent b2a455a commit 7b51a1d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
Expand Up @@ -332,6 +332,10 @@ - (void)transitionWithArgs:(NSDictionary *)args withProperty:(NSString *)propert
transition:(WXTransition*)transition
transitionDic:(NSMutableDictionary*)transitionDic
{
if (args[@"styles"][property] == nil) {
return;
}

[transition.filterStyles setObject:args[@"styles"][property] forKey:property];

id oldStyleValue = target.styles[property];
Expand All @@ -346,7 +350,7 @@ - (void)transitionWithArgs:(NSDictionary *)args withProperty:(NSString *)propert
[target _modifyStyles:@{property:args[@"styles"][property]}];
[transitionDic setObject:@([args[@"duration"] doubleValue]) forKey:kWXTransitionDuration];
[transitionDic setObject:@([args[@"delay"] doubleValue]) forKey:kWXTransitionDelay];
[transitionDic setObject:args[@"timingFunction"] forKey:kWXTransitionTimingFunction];
[transitionDic setObject:args[@"timingFunction"] ?: @"linear" forKey:kWXTransitionTimingFunction];
}

- (void)animation:(WXComponent *)targetComponent args:(NSDictionary *)args callback:(WXModuleKeepAliveCallback)callback
Expand Down

0 comments on commit 7b51a1d

Please sign in to comment.