Bug 1168653 - B2G telemetry needs to ignore search service r=gfritzsche a=sledru
authorFabrice Desré <fabrice@mozilla.com>
Wed, 27 May 2015 22:50:54 -0700
changeset 275135 c8f4915ec89c54d053181ffc6aab7cd1e74feff8
parent 275134 be983703a966c56dc345b1f02d465ca7d8ce133f
child 275136 b8c275bd325537a60f25da4781fafc6dfb2828a2
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfritzsche, sledru
bugs1168653
milestone40.0a2
Bug 1168653 - B2G telemetry needs to ignore search service r=gfritzsche a=sledru
toolkit/components/telemetry/TelemetryEnvironment.jsm
--- a/toolkit/components/telemetry/TelemetryEnvironment.jsm
+++ b/toolkit/components/telemetry/TelemetryEnvironment.jsm
@@ -866,16 +866,21 @@ EnvironmentCache.prototype = {
 
     return name;
   },
 
   /**
    * Update the default search engine value.
    */
   _updateSearchEngine: function () {
+    if (!Services.search) {
+      // Just ignore cases where the search service is not implemented.
+      return;
+    }
+
     this._log.trace("_updateSearchEngine - isInitialized: " + Services.search.isInitialized);
     if (!Services.search.isInitialized) {
       return;
     }
 
     // Make sure we have a settings section.
     this._currentEnvironment.settings = this._currentEnvironment.settings || {};
     // Update the search engine entry in the current environment.