diff options
author | snej@chromium.org <snej@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-01 20:39:06 +0000 |
---|---|---|
committer | snej@chromium.org <snej@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-01 20:39:06 +0000 |
commit | 10db9c6727f141487be79c89d00b6f9bf4d978dd (patch) | |
tree | fdb48e8dba20ee7254ed76cd59ab3688acbb79c5 /chrome/browser/cocoa | |
parent | caa0a4a03741286f3d2cc3b4b9c8a8261550a8db (diff) | |
download | chromium_src-10db9c6727f141487be79c89d00b6f9bf4d978dd.zip chromium_src-10db9c6727f141487be79c89d00b6f9bf4d978dd.tar.gz chromium_src-10db9c6727f141487be79c89d00b6f9bf4d978dd.tar.bz2 |
Fix Mac browser crash in BookmarkMenuBridge::UpdateMenu.
BUG=33890
TEST=none (see steps to repro in bug report)
Review URL: http://codereview.chromium.org/557085
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37736 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r-- | chrome/browser/cocoa/bookmark_menu_bridge.mm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/bookmark_menu_bridge.mm b/chrome/browser/cocoa/bookmark_menu_bridge.mm index d974224..006b10b 100644 --- a/chrome/browser/cocoa/bookmark_menu_bridge.mm +++ b/chrome/browser/cocoa/bookmark_menu_bridge.mm @@ -47,6 +47,9 @@ void BookmarkMenuBridge::UpdateMenu(NSMenu* bookmark_menu) { DCHECK(bookmark_menu); if (menuIsValid_) return; + BookmarkModel* model = GetBookmarkModel(); + if (!model || !model->IsLoaded()) + return; if (!folder_image_) { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); @@ -56,7 +59,8 @@ void BookmarkMenuBridge::UpdateMenu(NSMenu* bookmark_menu) { ClearBookmarkMenu(bookmark_menu); // Add bookmark bar items, if any. - const BookmarkNode* barNode = GetBookmarkModel()->GetBookmarkBarNode(); + const BookmarkNode* barNode = model->GetBookmarkBarNode(); + CHECK(barNode); if (barNode->GetChildCount()) { [bookmark_menu addItem:[NSMenuItem separatorItem]]; AddNodeToMenu(barNode, bookmark_menu); @@ -67,7 +71,7 @@ void BookmarkMenuBridge::UpdateMenu(NSMenu* bookmark_menu) { l10n_util::GetString(IDS_BOOMARK_BAR_OTHER_FOLDER_NAME)); [bookmark_menu addItem:[NSMenuItem separatorItem]]; AddNodeAsSubmenu(bookmark_menu, - GetBookmarkModel()->other_node(), + model->other_node(), other_items_title); menuIsValid_ = true; |