Commit 3163197d authored by aliceli1's avatar aliceli1
Browse files

Rubber-stamped by Hyatt.

        Adding null check to prevent the crash that happens on 2nd run of iBench HTML load test

        * loader/icon/IconDataCache.cpp:
        (WebCore::IconDataCache::writeToDatabase):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20198 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 15b52e0a
2007-03-14 Alice Liu <alice.liu@apple.com>
Rubber-stamped by Hyatt.
Adding null check to prevent the crash that happens on 2nd run of iBench HTML load test
* loader/icon/IconDataCache.cpp:
(WebCore::IconDataCache::writeToDatabase):
2007-03-14 Adele Peterson <adele@apple.com>
 
Reviewed by Adam.
......
......@@ -111,7 +111,7 @@ void IconDataCache::writeToDatabase(SQLDatabase& db)
// If we *have* image data, bind it to this statement - Otherwise the DB will get "null" for the blob data,
// signifying that this icon doesn't have any data
if (m_image && !m_image->data()->isEmpty())
if (m_image && m_image->data() && !m_image->data()->isEmpty())
if (updateAttempt.bindBlob(2, m_image->data()->data(), m_image->data()->size()) != SQLResultOk) {
LOG_ERROR("Failed to bind icon data to SQL statement to update icon data for url %s", m_iconURL.ascii().data());
return;
......@@ -138,7 +138,7 @@ void IconDataCache::writeToDatabase(SQLDatabase& db)
// Then, if we *have* data, we bind it. Otherwise the DB will get "null" for the blob data,
// signifying that this icon doesn't have any data
if (m_image && !m_image->data()->isEmpty())
if (m_image && m_image->data() && !m_image->data()->isEmpty())
insertStatement.bindBlob(3, m_image->data()->data(), m_image->data()->size());
// Finally we step and make sure the step was successful
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment