Crash in WebProcess at com.apple.WebCore: WebCore::Page::goToItem + 46
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Feb 2011 03:43:43 +0000 (03:43 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Feb 2011 03:43:43 +0000 (03:43 +0000)
<rdar://problem/8942726>

Reviewed by Dan Bernstein.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::goForward):
(WebKit::WebPage::goBack):
(WebKit::WebPage::goToBackForwardItem):
Defend agains null HistoryItems.

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index 7e02f87c412a088c9f09d5a9436554704bc62d02..368a4e8d7e577fa84cf3e39a8a664031dc7c4198 100644 (file)
@@ -1,3 +1,16 @@
+2011-02-20  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Dan Bernstein.
+
+        Crash in WebProcess at com.apple.WebCore: WebCore::Page::goToItem + 46
+        <rdar://problem/8942726>
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::goForward):
+        (WebKit::WebPage::goBack):
+        (WebKit::WebPage::goToBackForwardItem):
+        Defend agains null HistoryItems.
+
 2011-02-20  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Maciej Stachowiak.
index ff5399c6c4171a4d48d0c693faa58aad69f480bd..e491230da5a14c868fdb198507b956f6b90871ef 100644 (file)
@@ -487,25 +487,34 @@ void WebPage::reload(bool reloadFromOrigin)
 
 void WebPage::goForward(uint64_t backForwardItemID, const SandboxExtension::Handle& sandboxExtensionHandle)
 {
-    m_sandboxExtensionTracker.beginLoad(m_mainFrame.get(), sandboxExtensionHandle);
-
     HistoryItem* item = WebBackForwardListProxy::itemForID(backForwardItemID);
+    ASSERT(item);
+    if (!item)
+        return;
+
+    m_sandboxExtensionTracker.beginLoad(m_mainFrame.get(), sandboxExtensionHandle);
     m_page->goToItem(item, FrameLoadTypeForward);
 }
 
 void WebPage::goBack(uint64_t backForwardItemID, const SandboxExtension::Handle& sandboxExtensionHandle)
 {
-    m_sandboxExtensionTracker.beginLoad(m_mainFrame.get(), sandboxExtensionHandle);
-
     HistoryItem* item = WebBackForwardListProxy::itemForID(backForwardItemID);
+    ASSERT(item);
+    if (!item)
+        return;
+
+    m_sandboxExtensionTracker.beginLoad(m_mainFrame.get(), sandboxExtensionHandle);
     m_page->goToItem(item, FrameLoadTypeBack);
 }
 
 void WebPage::goToBackForwardItem(uint64_t backForwardItemID, const SandboxExtension::Handle& sandboxExtensionHandle)
 {
-    m_sandboxExtensionTracker.beginLoad(m_mainFrame.get(), sandboxExtensionHandle);
-
     HistoryItem* item = WebBackForwardListProxy::itemForID(backForwardItemID);
+    ASSERT(item);
+    if (!item)
+        return;
+
+    m_sandboxExtensionTracker.beginLoad(m_mainFrame.get(), sandboxExtensionHandle);
     m_page->goToItem(item, FrameLoadTypeIndexedBackForward);
 }