From cc04ddbe4d3c18f40371448beaa31efe5f59b6f2 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 15 Sep 2017 20:42:17 -0400 Subject: [PATCH] Fix test failure after 8215ba7a1d5c --- chrome/content/zotero/bindings/styled-textbox.xml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/bindings/styled-textbox.xml b/chrome/content/zotero/bindings/styled-textbox.xml index 9214a5a598..b7371eb767 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); }