summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-24 02:00:41 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-24 02:00:41 +0000
commitd4a5ab28e9b97e9b18875611305c3f5cc03f802c (patch)
tree6d6fd5c6ede70c4f8f390375099293e9b9288142
parent1385ef8ecb8e436cfb97eb2231d9168f81beb09b (diff)
downloadchromium_src-d4a5ab28e9b97e9b18875611305c3f5cc03f802c.zip
chromium_src-d4a5ab28e9b97e9b18875611305c3f5cc03f802c.tar.gz
chromium_src-d4a5ab28e9b97e9b18875611305c3f5cc03f802c.tar.bz2
Avoid calling ExecuteCode() on a NULL TabContents. The problem was an extra set of parens were missing, so the "not" operator only applied to the GetTabById() return value.
BUG=34778 Review URL: http://codereview.chromium.org/1238001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42421 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/execute_code_in_tab_function.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/chrome/browser/extensions/execute_code_in_tab_function.cc b/chrome/browser/extensions/execute_code_in_tab_function.cc
index 27ccf3f..a7ac42a 100644
--- a/chrome/browser/extensions/execute_code_in_tab_function.cc
+++ b/chrome/browser/extensions/execute_code_in_tab_function.cc
@@ -128,9 +128,12 @@ void ExecuteCodeInTabFunction::DidLoadFile(bool success,
bool ExecuteCodeInTabFunction::Execute(const std::string& code_string) {
TabContents* contents = NULL;
Browser* browser = NULL;
- if (!ExtensionTabUtil::GetTabById(execute_tab_id_, profile(),
- include_incognito(), &browser, NULL,
- &contents, NULL) && contents && browser) {
+
+ bool success = ExtensionTabUtil::GetTabById(
+ execute_tab_id_, profile(), include_incognito(), &browser, NULL,
+ &contents, NULL) && contents && browser;
+
+ if (!success) {
SendResponse(false);
return false;
}