diff --git a/MSCachedAsyncViewDrawing.m b/MSCachedAsyncViewDrawing.m index 9724841..db29db9 100644 --- a/MSCachedAsyncViewDrawing.m +++ b/MSCachedAsyncViewDrawing.m @@ -110,7 +110,7 @@ - (void)drawViewWithCacheKey:(NSString *)cacheKey } UIGraphicsEndImageContext(); - [self.cache setObject:resultImage forKey:cacheKey]; + if (resultImage) [self.cache setObject:resultImage forKey:cacheKey]; if (waitUntilDone) {