summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-06 18:55:04 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-06 18:55:04 +0000
commit11dbbd2ef4662ac1adfb74167ea9dca35066278e (patch)
tree810c87f10813c50e3a0dba3c3b5766de729705d8
parentc6d364185f837fbcb6869c286e8cfce5348c5d95 (diff)
downloadchromium_src-11dbbd2ef4662ac1adfb74167ea9dca35066278e.zip
chromium_src-11dbbd2ef4662ac1adfb74167ea9dca35066278e.tar.gz
chromium_src-11dbbd2ef4662ac1adfb74167ea9dca35066278e.tar.bz2
Attempt at fixing crash when showing bookmark model. The crash
indicates the node is null, which should only happen if adding the bookmark failed. Adding a bookmark can fail if the url isn't valid. BUG=26858 TEST=make sure star button still works Review URL: http://codereview.chromium.org/371011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31258 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/browser.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index be5c9c6..9f0f005 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -955,7 +955,9 @@ void Browser::BookmarkCurrentPage() {
&title);
bool was_bookmarked = model->IsBookmarked(url);
model->SetURLStarred(url, title, true);
- if (window_->IsActive()) {
+ // Make sure the model actually added a bookmark before showing the star. A
+ // bookmark isn't created if the url is invalid.
+ if (window_->IsActive() && model->IsBookmarked(url)) {
// Only show the bubble if the window is active, otherwise we may get into
// weird situations were the bubble is deleted as soon as it is shown.
window_->ShowBookmarkBubble(url, was_bookmarked);