[go: nahoru, domu]

Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[iOS] Protect nil argument for convertContainerToImmutable.
Browse files Browse the repository at this point in the history
  • Loading branch information
qianyuan.wqy committed Aug 12, 2019
1 parent 23c3acf commit c09b54b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,12 @@ + (id _Nullable)convertContainerToImmutable:(id _Nullable)source
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];
Expand Down

0 comments on commit c09b54b

Please sign in to comment.