Bug 1460601 - Fix up Prompt.jsm Dispatcher retrieval. r?jchen
Forgotten in
bug 1459298.
MozReview-Commit-ID: ANOK5Mp709K
--- a/mobile/android/modules/Prompt.jsm
+++ b/mobile/android/modules/Prompt.jsm
@@ -177,18 +177,24 @@ Prompt.prototype = {
show: function(callback) {
this.callback = callback;
log("Sending message");
this._innerShow();
},
_innerShow: function() {
- let dispatcher = GeckoViewUtils.getDispatcherForWindow(this.window) ||
- GeckoViewUtils.getActiveDispatcher();
+ let dispatcher;
+ if (this.window) {
+ dispatcher = GeckoViewUtils.getDispatcherForWindow(this.window);
+ }
+ if (!dispatcher) {
+ [dispatcher] = GeckoViewUtils.getActiveDispatcherAndWindow();
+ }
+
dispatcher.sendRequestForResult(this.msg).then((data) => {
if (this.callback) {
this.callback(data);
}
});
},
_setListItems: function(aItems) {