diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-22 18:21:03 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-22 18:21:03 +0000 |
commit | ce577c100b55d4d1a446ba3a0171759b7ca5dff3 (patch) | |
tree | c31091bd9ea7c5e819c1f1cee789469bf0c83e6b | |
parent | 8cd7fd05921738dab7a0d9645217f21bfc38fa90 (diff) | |
download | chromium_src-ce577c100b55d4d1a446ba3a0171759b7ca5dff3.zip chromium_src-ce577c100b55d4d1a446ba3a0171759b7ca5dff3.tar.gz chromium_src-ce577c100b55d4d1a446ba3a0171759b7ca5dff3.tar.bz2 |
Coverity: Check the return of GetTabId before using it.
Coverity issue 7161.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/2873060
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53361 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/extensions/extension_page_actions_module.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/chrome/browser/extensions/extension_page_actions_module.cc b/chrome/browser/extensions/extension_page_actions_module.cc index f91c5ef..cdeb892 100644 --- a/chrome/browser/extensions/extension_page_actions_module.cc +++ b/chrome/browser/extensions/extension_page_actions_module.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// 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. @@ -68,9 +68,9 @@ bool PageActionFunction::SetPageActionEnabled(bool enable) { // Find the TabContents that contains this tab id. TabContents* contents = NULL; - ExtensionTabUtil::GetTabById(tab_id, profile(), include_incognito(), - NULL, NULL, &contents, NULL); - if (!contents) { + bool result = ExtensionTabUtil::GetTabById( + tab_id, profile(), include_incognito(), NULL, NULL, &contents, NULL); + if (!result || !contents) { error_ = ExtensionErrorUtils::FormatErrorMessage(kNoTabError, IntToString(tab_id)); return false; @@ -101,9 +101,9 @@ bool PageActionFunction::InitCommon(int tab_id) { // Find the TabContents that contains this tab id. contents_ = NULL; - ExtensionTabUtil::GetTabById(tab_id, profile(), include_incognito(), - NULL, NULL, &contents_, NULL); - if (!contents_) { + bool result = ExtensionTabUtil::GetTabById( + tab_id, profile(), include_incognito(), NULL, NULL, &contents_, NULL); + if (!result || !contents_) { error_ = ExtensionErrorUtils::FormatErrorMessage(kNoTabError, IntToString(tab_id)); return false; |