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:12 UTC
[incubator-weex] 01/01: [iOS] Protect nil argument for
convertContainerToImmutable.
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];