diff --git a/Pod/Classes/PHImageManager+TNKRequestImages.m b/Pod/Classes/PHImageManager+TNKRequestImages.m index 3cd6928..5d42e49 100644 --- a/Pod/Classes/PHImageManager+TNKRequestImages.m +++ b/Pod/Classes/PHImageManager+TNKRequestImages.m @@ -30,8 +30,10 @@ - (NSDictionary *)requestImagesForAssets:(NSArray *)assets dispatch_group_enter(group); PHImageRequestID requestID = [self requestImageForAsset:asset targetSize:targetSize contentMode:contentMode options:options resultHandler:^(UIImage *result, NSDictionary *info) { - results[asset.localIdentifier] = result; - infos[asset.localIdentifier] = info; + if (result != nil && info != nil) { + results[asset.localIdentifier] = result; + infos[asset.localIdentifier] = info; + } dispatch_group_leave(group); }]; diff --git a/Pod/Classes/TNKAssetImageView.m b/Pod/Classes/TNKAssetImageView.m index 065fdb0..3575438 100644 --- a/Pod/Classes/TNKAssetImageView.m +++ b/Pod/Classes/TNKAssetImageView.m @@ -22,12 +22,14 @@ @implementation TNKAssetImageView - (void)setAsset:(PHAsset *)asset { - [self cancelAssetImageRequest]; - - _asset = asset; - self.image = self.defaultImage; - - [self setNeedsAssetReload]; + if (_asset != asset) { + [self cancelAssetImageRequest]; + + _asset = asset; + self.image = self.defaultImage; + + [self setNeedsAssetReload]; + } } - (void)setNeedsAssetReload