Bug 1399397 - Fix ActivityStream search when a link is dragged into the search-bar. r=Mardak
authorahillier <ahillier@mozilla.com>
Wed, 13 Sep 2017 16:34:52 -0400
changeset 430250 dc6acc3b97070f454dce6ce8ee595b18b5bac2c0
parent 430249 40e071f08bf6a3c4f97f77f02fc83ba93dda06e6
child 430251 ec5526fce679a088d91baf146d3d9507253dd3e7
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMardak
bugs1399397
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1399397 - Fix ActivityStream search when a link is dragged into the search-bar. r=Mardak MozReview-Commit-ID: Jy7ElORSUSx
browser/base/content/contentSearchUI.js
--- a/browser/base/content/contentSearchUI.js
+++ b/browser/base/content/contentSearchUI.js
@@ -241,17 +241,18 @@ ContentSearchUIController.prototype = {
   search(aEvent) {
     if (!this.defaultEngine) {
       return; // Not initialized yet.
     }
 
     let searchText = this.input;
     let searchTerms;
     if (this._table.hidden ||
-        aEvent.originalTarget.id == "contentSearchDefaultEngineHeader" ||
+        (aEvent.originalTarget &&
+          aEvent.originalTarget.id == "contentSearchDefaultEngineHeader") ||
         aEvent instanceof KeyboardEvent) {
       searchTerms = searchText.value;
     } else {
       searchTerms = this.suggestionAtIndex(this.selectedIndex) || searchText.value;
     }
     // Send an event that will perform a search and Firefox Health Report will
     // record that a search from the healthReportKey passed to the constructor.
     let eventData = {