handle crash when the imagesIdArray is nil/not an array/empty
This commit is contained in:
parent
018d88002f
commit
7aa792020a
@ -248,6 +248,11 @@ RCT_EXPORT_METHOD(resizeImage:(NSDictionary*)image
|
||||
resolve:(RCTPromiseResolveBlock)resolve
|
||||
reject:(__unused RCTPromiseRejectBlock)reject {
|
||||
|
||||
if (!imagesIdArray || ![imagesIdArray isKindOfClass:[NSArray class]] || imagesIdArray.count <= 0 ) {
|
||||
resolve(@{@"images": @[]});
|
||||
return;
|
||||
}
|
||||
|
||||
NSMutableArray *assetsArray = [[NSMutableArray alloc] initWithArray:imagesIdArray];
|
||||
|
||||
PHImageRequestOptions *imageRequestOptions = [[PHImageRequestOptions alloc] init];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user