Index: chrome/browser/resources/print_preview/previewarea/margin_control.js |
diff --git a/chrome/browser/resources/print_preview/previewarea/margin_control.js b/chrome/browser/resources/print_preview/previewarea/margin_control.js |
index 07d2dcc6ad8f75d7a99a814c7cfd5e231d8906a1..d81c74242fcf133dc650e318f48368133e4e2d63 100644 |
--- a/chrome/browser/resources/print_preview/previewarea/margin_control.js |
+++ b/chrome/browser/resources/print_preview/previewarea/margin_control.js |
@@ -99,7 +99,7 @@ cr.define('print_preview', function() { |
* @private |
*/ |
this.isInError_ = false; |
- }; |
+ } |
/** |
* Event types dispatched by the margin control. |
@@ -327,13 +327,15 @@ cr.define('print_preview', function() { |
this.getElement(), |
'transitionend', |
this.onTransitionEnd_.bind(this)); |
- this.tracker.add( |
- this.textbox_, 'input', this.onTextboxInput_.bind(this)); |
- this.tracker.add( |
- this.textbox_, 'keydown', this.onTextboxKeyDown_.bind(this)); |
- this.tracker.add( |
- this.textbox_, 'focus', this.setIsFocused_.bind(this, true)); |
- this.tracker.add(this.textbox_, 'blur', this.onTexboxBlur_.bind(this)); |
+ if (this.textbox_) { |
dpapad
2017/05/08 20:40:10
The previous code assumed that this.textbox_ was a
rbpotter
2017/05/08 23:28:20
Done.
|
+ this.tracker.add( |
+ this.textbox_, 'input', this.onTextboxInput_.bind(this)); |
+ this.tracker.add( |
+ this.textbox_, 'keydown', this.onTextboxKeyDown_.bind(this)); |
+ this.tracker.add( |
+ this.textbox_, 'focus', this.setIsFocused_.bind(this, true)); |
+ this.tracker.add(this.textbox_, 'blur', this.onTexboxBlur_.bind(this)); |
+ } |
}, |
/** @override */ |