File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -223,12 +223,23 @@ - (BOOL)_retrieveImageForEntity:(id <FICEntity>)entity withFormatName:(NSString
223223
224224- (void )_imageDidLoad : (UIImage *)image forURL : (NSURL *)URL {
225225 NSDictionary *requestDictionary = [_requests objectForKey: URL];
226- if (image != nil && requestDictionary != nil ) {
226+ if (requestDictionary != nil ) {
227227 for (NSMutableDictionary *entityDictionary in [requestDictionary allValues ]) {
228228 id <FICEntity> entity = [entityDictionary objectForKey: FICImageCacheEntityKey];
229229 NSString *formatName = [entityDictionary objectForKey: FICImageCacheFormatKey];
230230 NSDictionary *completionBlocksDictionary = [entityDictionary objectForKey: FICImageCacheCompletionBlocksKey];
231- [self _processImage: image forEntity: entity withFormatName: formatName completionBlocksDictionary: completionBlocksDictionary];
231+ if (image != nil ){
232+ [self _processImage: image forEntity: entity withFormatName: formatName completionBlocksDictionary: completionBlocksDictionary];
233+ } else {
234+ NSArray *completionBlocks = [completionBlocksDictionary objectForKey: formatName];
235+ if (completionBlocks != nil ) {
236+ dispatch_async (dispatch_get_main_queue (), ^{
237+ for (FICImageCacheCompletionBlock completionBlock in completionBlocks) {
238+ completionBlock (entity, formatName, nil );
239+ }
240+ });
241+ }
242+ }
232243 }
233244 }
234245
You can’t perform that action at this time.
0 commit comments