Bug 1399397 - Fix ActivityStream search when a link is dragged into the search-bar. draft
authorahillier <ahillier@mozilla.com>
Wed, 13 Sep 2017 16:34:52 -0400
changeset 664269 7c39ff04607fd2c2fed067ceba3464aa871201c1
parent 663831 1888ec2f277f6bb26271b8808e08914a21db9efe
child 731408 6d3011c3397c1290f9dbc2406c21a17061eaa211
push id79658
push userbmo:ahillier@mozilla.com
push dateWed, 13 Sep 2017 20:35:35 +0000
bugs1399397
milestone57.0a1
Bug 1399397 - Fix ActivityStream search when a link is dragged into the search-bar. 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 = {