diff --git a/chrome/content/zotero/bindings/styled-textbox.xml b/chrome/content/zotero/bindings/styled-textbox.xml index 9214a5a59..b7371eb76 100644 --- a/chrome/content/zotero/bindings/styled-textbox.xml +++ b/chrome/content/zotero/bindings/styled-textbox.xml @@ -48,7 +48,6 @@ RTF (cleanup) @@ -624,6 +623,9 @@ callback(this._editor); } else { + if (!this._onInitCallbacks) { + this._onInitCallbacks = []; + } this._onInitCallbacks.push(callback); } ]]> @@ -730,8 +732,10 @@ } let cb; - while (cb = this._onInitCallbacks.shift()) { - cb(this._editor); + if (this._onInitCallbacks) { + while (cb = this._onInitCallbacks.shift()) { + cb(this._editor); + } } }.bind(this); }