<https://bugs.webkit.org/show_bug.cgi?id=62666>
[WebKit-https.git] / Source / WebKit2 / Shared / UserMessageCoders.h
index ad72493e559eb3afbe9c36dbb0e1199f246e8a3e..2bec5f1b590bf5143a56d2517178c43203938ae5 100644 (file)
@@ -127,13 +127,13 @@ public:
         }
         case APIObject::TypeImage: {
             WebImage* image = static_cast<WebImage*>(m_root);
-            if (!image->bitmap()->isBackedBySharedMemory()) {
+            if (!image->bitmap() || !image->bitmap()->isBackedBySharedMemory()) {
                 encoder->encode(false);
                 return true;
             }
 
             ShareableBitmap::Handle handle;
-            if (!image->bitmap()->createHandle(handle))
+            if (!image->bitmap() || !image->bitmap()->createHandle(handle))
                 return false;
 
             encoder->encode(true);