diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-29 20:33:11 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-29 20:33:11 +0000 |
commit | 450d9cc6e1670ba92cd52713c110c17c33b4fc71 (patch) | |
tree | 04ee541215f02d3df84105e38f2491e321be1c5a /chrome/browser/navigation_controller.cc | |
parent | b6545a45fac4b9833ef2e31970a1b1c0a5830950 (diff) | |
download | chromium_src-450d9cc6e1670ba92cd52713c110c17c33b4fc71.zip chromium_src-450d9cc6e1670ba92cd52713c110c17c33b4fc71.tar.gz chromium_src-450d9cc6e1670ba92cd52713c110c17c33b4fc71.tar.bz2 |
Fixes crash in NavigationController that occured on closing tab if
only navigation in tab was an interstitial.
BUG=2964
TEST=Drag the following URL into
Review URL: http://codereview.chromium.org/4337
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2688 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/navigation_controller.cc')
-rw-r--r-- | chrome/browser/navigation_controller.cc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/chrome/browser/navigation_controller.cc b/chrome/browser/navigation_controller.cc index 0cecdc3..e8908fe 100644 --- a/chrome/browser/navigation_controller.cc +++ b/chrome/browser/navigation_controller.cc @@ -858,16 +858,18 @@ void NavigationController::RemoveLastEntryForInterstitial() { if (last_committed_entry_index_ >= current_size - 1) { last_committed_entry_index_ = current_size - 2; - // Broadcast the notification of the navigation. This is kind of a hack, - // since the navigation wasn't actually committed. But this function is - // used for interstital pages, and the UI needs to get updated when the - // interstitial page - LoadCommittedDetails details; - details.entry = GetActiveEntry(); - details.is_auto = false; - details.is_in_page = false; - details.is_main_frame = true; - NotifyNavigationEntryCommitted(&details); + if (last_committed_entry_index_ != -1) { + // Broadcast the notification of the navigation. This is kind of a hack, + // since the navigation wasn't actually committed. But this function is + // used for interstital pages, and the UI needs to get updated when the + // interstitial page + LoadCommittedDetails details; + details.entry = GetActiveEntry(); + details.is_auto = false; + details.is_in_page = false; + details.is_main_frame = true; + NotifyNavigationEntryCommitted(&details); + } } NotifyPrunedEntries(this, false, 1); |