Commit efc19ce1 authored by beidson's avatar beidson

Reviewed by Adele

        <rdar://problem/4917290> - 
        Null deref in WebFrameLoaderClient::restoreScrollPositionAndViewState() 
        after regaining network connection

        * WebCoreSupport/WebFrameLoaderClient.mm:
        (WebFrameLoaderClient::restoreScrollPositionAndViewState): Bail early with a null currentItem, preventing 
        a crash in release builds.  Leave the ASSERT to help find other cases where this might happen in debug builds.



git-svn-id: svn://svn.chromium.org/blink/trunk@18967 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 4683e2a7
2007-01-18 Brady Eidson <beidson@apple.com>
Reviewed by Adele
<rdar://problem/4917290> -
Null deref in WebFrameLoaderClient::restoreScrollPositionAndViewState()
after regaining network connection
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::restoreScrollPositionAndViewState): Bail early with a null currentItem, preventing
a crash in release builds. Leave the ASSERT to help find other cases where this might happen in debug builds.
2007-01-18 Kevin Decker <kdecker@apple.com>
Reviewed by John.
......
......@@ -824,6 +824,15 @@ void WebFrameLoaderClient::restoreScrollPositionAndViewState()
{
HistoryItem* currentItem = core(m_webFrame.get())->loader()->currentHistoryItem();
ASSERT(currentItem);
// FIXME: As the ASSERT attests, it seems we should always have a currentItem here.
// One counterexample is <rdar://problem/4917290>
// For now, to cover this issue in release builds, there is no technical harm to returning
// early and from a user standpoint - as in the above radar - the previous page load failed
// so there *is* no scroll state to restore!
if (!currentItem)
return;
NSView <WebDocumentView> *docView = [m_webFrame->_private->webFrameView documentView];
NSPoint point = currentItem->scrollPoint();
if ([docView conformsToProtocol:@protocol(_WebDocumentViewState)]) {
......
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