You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by mo...@apache.org on 2019/08/01 03:06:53 UTC

[incubator-weex] branch fix-animation-crash created (now 6b47d48)

This is an automated email from the ASF dual-hosted git repository.

moshen pushed a change to branch fix-animation-crash
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git.


      at 6b47d48  [iOS] Protect animation argument missing which cause crash on iOS.

This branch includes the following new commits:

     new 6b47d48  [iOS] Protect animation argument missing which cause crash on iOS.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[incubator-weex] 01/01: [iOS] Protect animation argument missing which cause crash on iOS.

Posted by mo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

moshen pushed a commit to branch fix-animation-crash
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git

commit 6b47d4878fac47b024ddd6e1ea2e22c86ae18305
Author: qianyuan.wqy <qi...@taobao.com>
AuthorDate: Thu Aug 1 11:06:42 2019 +0800

    [iOS] Protect animation argument missing which cause crash on iOS.
---
 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