You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ji...@apache.org on 2019/08/01 03:08:35 UTC
[incubator-weex] branch master updated: [iOS] Protect animation
argument missing which cause crash on iOS. (#2771)
This is an automated email from the ASF dual-hosted git repository.
jianhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git
The following commit(s) were added to refs/heads/master by this push:
new 7b51a1d [iOS] Protect animation argument missing which cause crash on iOS. (#2771)
7b51a1d is described below
commit 7b51a1dbec2c234f88447b288efaee024feeb147
Author: wqyfavor <qi...@alibaba-inc.com>
AuthorDate: Thu Aug 1 11:08:30 2019 +0800
[iOS] Protect animation argument missing which cause crash on iOS. (#2771)
---
ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
index 7c77455..2e94053 100644
--- a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
+++ b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
@@ -332,6 +332,10 @@ WX_EXPORT_METHOD(@selector(transition:args:callback:))
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];
@@ -346,7 +350,7 @@ WX_EXPORT_METHOD(@selector(transition:args:callback:))
[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