Assertions or crashes under _takeViewSnapshot when restoring windows
[WebKit-https.git] / Source / WebCore / platform / graphics / cocoa / IOSurface.mm
index b72f3bd1538de1bb23831f3268dd51475984541f..4d85a6185d04550ec8e27c31bb5e83a7d9beac8b 100644 (file)
@@ -72,6 +72,9 @@ PassRefPtr<IOSurface> IOSurface::createFromSurface(IOSurfaceRef surface, ColorSp
 
 PassRefPtr<IOSurface> IOSurface::createFromImage(CGImageRef image)
 {
+    if (!image)
+        return nullptr;
+
     size_t width = CGImageGetWidth(image);
     size_t height = CGImageGetHeight(image);