weex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jian...@apache.org
Subject [incubator-weex] branch master updated: [iOS] Protect animation argument missing which cause crash on iOS. (#2771)
Date Thu, 01 Aug 2019 03:08:35 GMT
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 <qianyuan.wqy@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


Mime
View raw message