Commit df204d27 authored by David Valleau's avatar David Valleau Committed by Commit Bot

Adding a check for nullptr in UpdateRecommendedPrinters

R=skau@chromium.org

Bug: 779256
Change-Id: I5772282ee310a594b5e31d5931fa38a6fa67cde8
Reviewed-on: https://chromium-review.googlesource.com/755417Reviewed-by: default avatarSean Kau <skau@chromium.org>
Commit-Queue: David Valleau <valleau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515980}
parent 34f6bd7e
...@@ -198,9 +198,15 @@ class SyncedPrintersManagerImpl : public SyncedPrintersManager, ...@@ -198,9 +198,15 @@ class SyncedPrintersManagerImpl : public SyncedPrintersManager,
LOG(WARNING) << "Duplicate printer ignored."; LOG(WARNING) << "Duplicate printer ignored.";
continue; continue;
} }
auto new_printer = RecommendedPrinterToPrinter(*printer_dictionary);
if (!new_printer) {
LOG(WARNING) << "Recommended printer is malformed.";
continue;
}
new_ids.push_back(id); new_ids.push_back(id);
new_printers.insert( new_printers.insert({id, *new_printer});
{id, *RecommendedPrinterToPrinter(*printer_dictionary)});
} }
// Objects not in the most recent update get deallocated after method // Objects not in the most recent update get deallocated after method
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment