Bug 1455261 - Check for null metadata to workaround broken search.json. r=adw, a=RyanVM
authorMichael Kaply <mozilla@kaply.com>
Fri, 01 Jun 2018 16:59:03 -0500
changeset 473749 c1e1ada55d728167267ff5cb9c6fd30ceb97b71d
parent 473748 7e89c803d7da1017105a7d364246b2dd8c1d7bc1
child 473750 70c46487e5132963906f5caab8e0181e7b5e772e
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw, RyanVM
bugs1455261
milestone61.0
Bug 1455261 - Check for null metadata to workaround broken search.json. r=adw, a=RyanVM MozReview-Commit-ID: 4D2F30MHaqE
toolkit/components/search/nsSearchService.js
--- a/toolkit/components/search/nsSearchService.js
+++ b/toolkit/components/search/nsSearchService.js
@@ -2069,17 +2069,17 @@ Engine.prototype = {
     return json;
   },
 
   setAttr(name, val) {
     this._metaData[name] = val;
   },
 
   getAttr(name) {
-    return this._metaData[name] || undefined;
+    return (this._metaData && this._metaData[name]) || undefined;
   },
 
   // nsISearchEngine
   get alias() {
     return this.getAttr("alias");
   },
   set alias(val) {
     var value = val ? val.trim() : null;