diff options
author | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-09 00:23:00 +0000 |
---|---|---|
committer | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-09 00:23:00 +0000 |
commit | 2bfc319546d3cd8d2611f22a5cf58e1996ea8ec9 (patch) | |
tree | 5e65d2fefd0701e7ee02354966318eb7cfc2742a /chrome/browser/page_menu_model.cc | |
parent | 2e0b84e7d2a676a706f99a796718a7c2171165d5 (diff) | |
download | chromium_src-2bfc319546d3cd8d2611f22a5cf58e1996ea8ec9.zip chromium_src-2bfc319546d3cd8d2611f22a5cf58e1996ea8ec9.tar.gz chromium_src-2bfc319546d3cd8d2611f22a5cf58e1996ea8ec9.tar.bz2 |
Tentative fix for crash in EncodingMenuController::IsItemChecked.
BUG=36180
TEST=unittest
Review URL: http://codereview.chromium.org/1591026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44033 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/page_menu_model.cc')
-rw-r--r-- | chrome/browser/page_menu_model.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/chrome/browser/page_menu_model.cc b/chrome/browser/page_menu_model.cc index 39836c0..0bccc36 100644 --- a/chrome/browser/page_menu_model.cc +++ b/chrome/browser/page_menu_model.cc @@ -1,6 +1,6 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this -// source code is governed by a BSD-style license that can be found in the -// LICENSE file. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. #include "chrome/browser/page_menu_model.h" @@ -90,6 +90,8 @@ void EncodingMenuModel::Build() { bool EncodingMenuModel::IsCommandIdChecked(int command_id) const { TabContents* current_tab = browser_->GetSelectedTabContents(); + if (!current_tab) + return false; EncodingMenuController controller; return controller.IsItemChecked(browser_->profile(), current_tab->encoding(), command_id); |