diff --git a/browser/components/customizableui/test/browser_940307_panel_click_closure_handling.js b/browser/components/customizableui/test/browser_940307_panel_click_closure_handling.js index cb28a3c9dd4c..3c870b12c66d 100644 --- a/browser/components/customizableui/test/browser_940307_panel_click_closure_handling.js +++ b/browser/components/customizableui/test/browser_940307_panel_click_closure_handling.js @@ -101,6 +101,7 @@ add_task(function*() { ok(!isPanelUIOpen(), "Panel should no longer be open"); Services.prefs.setBoolPref("browser.search.suggest.enabled", suggestEnabled); + CustomizableUI.reset(); }); add_task(function*() { diff --git a/toolkit/components/search/SearchSuggestionController.jsm b/toolkit/components/search/SearchSuggestionController.jsm index f312e85e927a..8109fbb35849 100644 --- a/toolkit/components/search/SearchSuggestionController.jsm +++ b/toolkit/components/search/SearchSuggestionController.jsm @@ -318,7 +318,13 @@ this.SearchSuggestionController.prototype = { * @return {Object} */ _dedupeAndReturnResults: function(suggestResults) { - NS_ASSERT(this._searchString !== null, "this._searchString shouldn't be null when returning results"); + if (this._searchString === null) { + // _searchString can be null if stop() was called and remote suggestions + // were disabled (stopping if we are fetching remote suggestions will + // cause a promise rejection before we reach _dedupeAndReturnResults). + return null; + } + let results = { term: this._searchString, remote: [],