From 39f1cc1028eca283a8edccdef5389c095f6ee3b0 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 27 Nov 2014 06:54:15 -0800 Subject: [PATCH] Don't try to put corrupt PNG files into iconCache. --- Library.mm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Library.mm b/Library.mm index d400f4c..4354560 100644 --- a/Library.mm +++ b/Library.mm @@ -2265,9 +2265,8 @@ MSHook(NSArray *, CPBitmapCreateImagesFromPath, NSString *path, CFTypeRef *names if (NSString *themed = $pathForFile$inBundle$([name stringByAppendingString:@".png"], bundle, true)) { if (indexes != nil) index = [[indexes objectForKey:name] intValue]; - UIImage *image($getImage$(themed)); - CGImageRef cg([image CGImage]); - [copy replaceObjectAtIndex:index withObject:(id)cg]; + if (UIImage *image = $getImage$(themed)) + [copy replaceObjectAtIndex:index withObject:(id)[image CGImage]]; } return images; -- 2.45.2