2008-02-17 Jan Michael Alonzo <jmalonzo@unpluggable.com>
authormrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 17 Feb 2008 12:12:54 +0000 (12:12 +0000)
committermrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 17 Feb 2008 12:12:54 +0000 (12:12 +0000)
        Reviewed by Mark Rowe.

        Fix a crash introduced in changeset #29985 by moving the dereference to after
        the null check.

        * webkit/webkitwebhistoryitem.cpp:
        (_WebKitWebHistoryItemPrivate::webkit_web_history_item_new_with_core_item):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@30353 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/gtk/ChangeLog
WebKit/gtk/webkit/webkitwebhistoryitem.cpp

index 988b88e96b8c1fc9b88780018fc306fdfc844dc2..a03fc1f4ed9515e365f21d786b4dadeca58f423a 100644 (file)
@@ -1,3 +1,13 @@
+2008-02-17  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
+
+        Reviewed by Mark Rowe.
+
+        Fix a crash introduced in changeset #29985 by moving the dereference to after
+        the null check.
+
+        * webkit/webkitwebhistoryitem.cpp:
+        (_WebKitWebHistoryItemPrivate::webkit_web_history_item_new_with_core_item):
+
 2008-02-15  Alp Toker  <alp@atoker.com>
 
         Fix the GTK+ build following breakage introduced in r30243.
index 5fbf8c1a1564d6143bf8b2605774523f28edbefa..d9c8cd0c664d8baa463937e08a767f1b789f6edb 100644 (file)
@@ -123,10 +123,10 @@ static void webkit_web_history_item_init(WebKitWebHistoryItem* webHistoryItem)
 WebKitWebHistoryItem* webkit_web_history_item_new_with_core_item(WebCore::HistoryItem* item)
 {
     WebKitWebHistoryItem* webHistoryItem = kit(item);
-    WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv;
 
     if (!webHistoryItem) {
         webHistoryItem = WEBKIT_WEB_HISTORY_ITEM(g_object_new(WEBKIT_TYPE_WEB_HISTORY_ITEM, NULL));
+        WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv;
         priv->historyItem = item;
         webkit_history_item_add(webHistoryItem, priv->historyItem);
     }