Index: chrome/browser/resources/print_preview/print_preview.js |
diff --git a/chrome/browser/resources/print_preview/print_preview.js b/chrome/browser/resources/print_preview/print_preview.js |
index ee2f46dad09722b6bd83698ed5043ec376836116..712e5cc5793146c89105431c8ebc565509f92d63 100644 |
--- a/chrome/browser/resources/print_preview/print_preview.js |
+++ b/chrome/browser/resources/print_preview/print_preview.js |
@@ -785,6 +785,7 @@ cr.define('print_preview', function() { |
if (e.keyCode == 13 /*enter*/ && |
!this.destinationSearch_.getIsVisible() && |
+ this.destinationStore_.selectedDestination && |
this.printTicketStore_.isTicketValid()) { |
assert(this.uiState_ == PrintPreview.UiState_.READY, |
'Trying to print when not in ready state: ' + this.uiState_); |
@@ -899,9 +900,10 @@ cr.define('print_preview', function() { |
*/ |
onDestinationSelect_: function() { |
var selectedDest = this.destinationStore_.selectedDestination; |
- setIsVisible($('cloud-print-dialog-link'), |
- !cr.isChromeOS && !selectedDest.isLocal); |
- if (this.isInKioskAutoPrintMode_) { |
+ setIsVisible( |
+ $('cloud-print-dialog-link'), |
+ selectedDest && !cr.isChromeOS && !selectedDest.isLocal); |
+ if (selectedDest && this.isInKioskAutoPrintMode_) { |
this.onPrintButtonClick_(); |
} |
}, |