Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1890)

Unified Diff: chrome/browser/resources/print_preview/native_layer.js

Issue 2848093002: Process null capabilities as a capability fetch failure. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/print_preview/native_layer.js
diff --git a/chrome/browser/resources/print_preview/native_layer.js b/chrome/browser/resources/print_preview/native_layer.js
index 22a94693450b9fed47d36c889a5c0af8b515e81e..7657d94325fb8c91a5a3dd75dd47b4b53212dbe6 100644
--- a/chrome/browser/resources/print_preview/native_layer.js
+++ b/chrome/browser/resources/print_preview/native_layer.js
@@ -550,6 +550,11 @@ cr.define('print_preview', function() {
* @private
*/
onUpdateWithPrinterCapabilities_: function(settingsInfo) {
+ if (settingsInfo.capabilities == null) {
dpapad 2017/05/01 17:39:28 Why are we doing this in Javascript instead of C++
skau 2017/05/01 22:51:26 It crept up as a bug. The code you referenced onl
+ this.onFailedToGetPrinterCapabilities_(settingsInfo['printerId']);
+ return;
+ }
+
var capsSetEvent = new Event(NativeLayer.EventType.CAPABILITIES_SET);
capsSetEvent.settingsInfo = settingsInfo;
this.dispatchEvent(capsSetEvent);

Powered by Google App Engine
This is Rietveld 408576698