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/12 02:21:11 UTC

[incubator-weex] branch protect-argument-convert created (now c09b54b)

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

moshen pushed a change to branch protect-argument-convert
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git.


      at c09b54b  [iOS] Protect nil argument for convertContainerToImmutable.

This branch includes the following new commits:

     new c09b54b  [iOS] Protect nil argument for convertContainerToImmutable.

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 nil argument for convertContainerToImmutable.

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

moshen pushed a commit to branch protect-argument-convert
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git

commit c09b54b818e5ca60aa58bcfc202f107e116047ff
Author: qianyuan.wqy <qi...@taobao.com>
AuthorDate: Mon Aug 12 10:20:55 2019 +0800

    [iOS] Protect nil argument for convertContainerToImmutable.
---
 ios/sdk/WeexSDK/Sources/Utility/WXUtility.m | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
index 73c1108..6ec4223 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
@@ -268,6 +268,12 @@ CGFloat WXFloorPixelValue(CGFloat value)
     if ([source isKindOfClass:[NSArray class]]) {
         NSMutableArray* tmpArray = [[NSMutableArray alloc] init];
         for (id obj in source) {
+            if (obj == nil) {
+                /* srouce may be a subclass of NSArray and the subclassed
+                 array may return nil in its overridden objectAtIndex: method.
+                 So obj could be nil!!!. */
+                continue;
+            }
             [tmpArray addObject:[self convertContainerToImmutable:obj]];
         }
         id immutableArray = [NSArray arrayWithArray:tmpArray];