Skip to content

Commit

Permalink
Fixed crash when croppedImage is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
donnellyk committed Nov 19, 2014
1 parent 93a6e3d commit ba2ebf0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/KVNBoundedImageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ - (void)resizeImage:(UIImage *)image name:(NSString *)name completion:(void(^)(U
UIImage *croppedImage = [[UIImage alloc] initWithCGImage:imageRef];
CGImageRelease(imageRef);

if (name) {
if (name && croppedImage) {
[[KVNBoundedImageView sharedCroppedImageCache] setObject:croppedImage forKey:[self cacheKeyWithName:name]];
}

Expand Down Expand Up @@ -428,4 +428,4 @@ static inline CGFloat AspectRatio(CGSize size) {
return size.width / size.height;
}

@end
@end

0 comments on commit ba2ebf0

Please sign in to comment.