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
diff --git a/chrome/browser/printing/print_dialog_cloud.cc b/chrome/browser/printing/print_dialog_cloud.cc
index 69c66e4d..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 @@
}
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 =