summaryrefslogtreecommitdiffstats
path: root/chrome/browser/printing
diff options
context:
space:
mode:
authorabodenha@chromium.org <abodenha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-04 18:45:11 +0000
committerabodenha@chromium.org <abodenha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-04 18:45:11 +0000
commit87ab41e75e18bdb786caa7d3038a380c9f1e9c67 (patch)
tree935064d4029c182c317ca13ee12551efe8537647 /chrome/browser/printing
parentd7f0b31e7f6e976a3305655ecf157961d5280e6c (diff)
downloadchromium_src-87ab41e75e18bdb786caa7d3038a380c9f1e9c67.zip
chromium_src-87ab41e75e18bdb786caa7d3038a380c9f1e9c67.tar.gz
chromium_src-87ab41e75e18bdb786caa7d3038a380c9f1e9c67.tar.bz2
Fix crash.
Adds a HasSwitch check before trying to access the contents of the switch when displaying the cloud print dialog from the command line. BUG=108687 TEST= Review URL: http://codereview.chromium.org/9008053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116340 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/printing')
-rw-r--r--chrome/browser/printing/print_dialog_cloud.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/chrome/browser/printing/print_dialog_cloud.cc b/chrome/browser/printing/print_dialog_cloud.cc
index 69c66e4..daf1213 100644
--- a/chrome/browser/printing/print_dialog_cloud.cc
+++ b/chrome/browser/printing/print_dialog_cloud.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -693,6 +693,7 @@ void CreatePrintDialogForBytes(scoped_refptr<RefCountedBytes> data,
}
bool CreatePrintDialogFromCommandLine(const CommandLine& command_line) {
+ DCHECK(command_line.HasSwitch(switches::kCloudPrintFile));
if (!command_line.GetSwitchValuePath(switches::kCloudPrintFile).empty()) {
FilePath cloud_print_file;
cloud_print_file =