diff options
author | gene@google.com <gene@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-28 17:41:08 +0000 |
---|---|---|
committer | gene@google.com <gene@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-28 17:41:08 +0000 |
commit | 59561632960aba6a221357accd42e41d1a957fe3 (patch) | |
tree | 1324e2c07cd98ad592be999521487a67360c325e /chrome/service | |
parent | 57517415728825a5789bcfbe4530c649ffc21764 (diff) | |
download | chromium_src-59561632960aba6a221357accd42e41d1a957fe3.zip chromium_src-59561632960aba6a221357accd42e41d1a957fe3.tar.gz chromium_src-59561632960aba6a221357accd42e41d1a957fe3.tar.bz2 |
Fixd issue with accessing null pointer, when print server
is unavailable on the gcp proxy start.
BUG=86875
TEST=Add a dummy server in the 'Service State', and run gcp proxy.
Review URL: http://codereview.chromium.org/7262027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94494 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service')
-rw-r--r-- | chrome/service/cloud_print/printer_job_handler.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/chrome/service/cloud_print/printer_job_handler.cc b/chrome/service/cloud_print/printer_job_handler.cc index 0d883d8..24170bf 100644 --- a/chrome/service/cloud_print/printer_job_handler.cc +++ b/chrome/service/cloud_print/printer_job_handler.cc @@ -163,6 +163,13 @@ void PrinterJobHandler::CheckForJobs(const std::string& reason) { } bool PrinterJobHandler::UpdatePrinterInfo() { + if (!printer_watcher_) { + LOG(ERROR) << "CP_PROXY: Printer watcher is missing." + << "Check printer server url for printer id: " + << printer_info_cloud_.printer_id; + return false; + } + VLOG(1) << "CP_PROXY: Update printer info, id: " << printer_info_cloud_.printer_id; // We need to update the parts of the printer info that have changed @@ -187,7 +194,8 @@ void PrinterJobHandler::OnReceivePrinterCaps( const std::string& printer_name, const printing::PrinterCapsAndDefaults& caps_and_defaults) { printing::PrinterBasicInfo printer_info; - printer_watcher_->GetCurrentPrinterInfo(&printer_info); + if (printer_watcher_) + printer_watcher_->GetCurrentPrinterInfo(&printer_info); std::string post_data; std::string mime_boundary; |