fix race condition which leads to crash

This commit is contained in:
Ran Greenberg 2017-11-19 17:48:16 +02:00
parent 3e26b32e9c
commit 207c244c4b

View File

@ -330,6 +330,10 @@ static NSString * const CustomCellReuseIdentifier = @"CustomCell";
}
if ([self.galleryData.data count] < cellIndex) {
return nil;
}
NSDictionary *assetDictionary = (NSDictionary*)self.galleryData.data[cellIndex];
PHAsset *asset = assetDictionary[@"asset"];