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 471308 c1e1ada55d72
parent 471307 7e89c803d7da
child 471309 70c46487e513
push id9364
push userryanvm@gmail.com
push dateWed, 13 Jun 2018 23:32:57 +0000
treeherdermozilla-beta@91934961833a [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;