Index: skia/ext/skia_utils_mac.mm |
diff --git a/skia/ext/skia_utils_mac.mm b/skia/ext/skia_utils_mac.mm |
index 3568d88bc75c6e12730c163f4ac2465045cc9fb6..a913587b6edc2798bfe833094f7687ab62d9d15b 100644 |
--- a/skia/ext/skia_utils_mac.mm |
+++ b/skia/ext/skia_utils_mac.mm |
@@ -168,6 +168,9 @@ SkBitmap NSImageToSkBitmap(NSImage* image, NSSize size, bool is_opaque) { |
} |
NSImage* SkBitmapToNSImage(const SkBitmap& skiaBitmap) { |
+ if (skiaBitmap.isNull()) |
+ return nil; |
+ |
// First convert SkBitmap to CGImageRef. |
CGImageRef cgimage = SkCreateCGImageRef(skiaBitmap); |