[GTK][WPE] ASSERTION FAILED: blob in SQLiteStatement.cpp(163) : int WebCore::SQLiteStatement::bindBlob()
https://bugs.webkit.org/show_bug.cgi?id=202976

Reviewed by Adrian Perez de Castro.

This is because IconDatabases passes a nullptr blob to store emtpty icons. sqlite3_bind_blob() allows nullptr as
blob, so we shouldn't assert.

* platform/sql/SQLiteStatement.cpp:
(WebCore::SQLiteStatement::bindBlob): Update the assert to only fail when blob is nullptr and size > 0.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@251185 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 2530563..1566464 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2019-10-16  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK][WPE] ASSERTION FAILED: blob in SQLiteStatement.cpp(163) : int WebCore::SQLiteStatement::bindBlob()
+        https://bugs.webkit.org/show_bug.cgi?id=202976
+
+        Reviewed by Adrian Perez de Castro.
+
+        This is because IconDatabases passes a nullptr blob to store emtpty icons. sqlite3_bind_blob() allows nullptr as
+        blob, so we shouldn't assert.
+
+        * platform/sql/SQLiteStatement.cpp:
+        (WebCore::SQLiteStatement::bindBlob): Update the assert to only fail when blob is nullptr and size > 0.
+
 2019-10-16  Fujii Hironori  <Hironori.Fujii@sony.com>
 
         Unreviewed build fix for Windows ports
diff --git a/Source/WebCore/platform/sql/SQLiteStatement.cpp b/Source/WebCore/platform/sql/SQLiteStatement.cpp
index d9b210b..482ef4e 100644
--- a/Source/WebCore/platform/sql/SQLiteStatement.cpp
+++ b/Source/WebCore/platform/sql/SQLiteStatement.cpp
@@ -160,7 +160,7 @@
     ASSERT(m_isPrepared);
     ASSERT(index > 0);
     ASSERT(static_cast<unsigned>(index) <= bindParameterCount());
-    ASSERT(blob);
+    ASSERT(blob || !size);
     ASSERT(size >= 0);
 
     if (!m_statement)