Bug 1272439 - Make distribution.searchplugins.defaultLocale work on Fennec. r=margaret
authorMichael Kaply <mozilla@kaply.com>
Tue, 31 May 2016 13:04:35 -0500
changeset 340669 62994b8424002efc18e8ba6b58471e051b42e930
parent 340668 7f6135916882e9dff30c5549e278f49f2fca2c17
child 340670 77fe72f30c9211b72235b099fb131bdbf98e7900
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1272439
milestone49.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 1272439 - Make distribution.searchplugins.defaultLocale work on Fennec. r=margaret
mobile/android/components/DirectoryProvider.js
--- a/mobile/android/components/DirectoryProvider.js
+++ b/mobile/android/components/DirectoryProvider.js
@@ -127,20 +127,24 @@ DirectoryProvider.prototype = {
       curLocalePlugins.append(curLocale);
       if (curLocalePlugins.exists()) {
         array.push(curLocalePlugins);
         return;
       }
     }
 
     // We didn't append the locale dir - try the default one.
-    let defLocale = Services.prefs.getCharPref("distribution.searchplugins.defaultLocale");
-    let defLocalePlugins = localePlugins.clone();
-    if (defLocalePlugins.exists())
-      array.push(defLocalePlugins);
+    try {
+      let defLocale = Services.prefs.getCharPref("distribution.searchplugins.defaultLocale");
+      let defLocalePlugins = localePlugins.clone();
+      defLocalePlugins.append(defLocale);
+      if (defLocalePlugins.exists())
+        array.push(defLocalePlugins);
+    } catch(e) {
+    }
   },
 
   getFiles: function(prop) {
     if (prop != NS_APP_SEARCH_DIR_LIST &&
         prop != NS_APP_DISTRIBUTION_SEARCH_DIR_LIST)
       return null;
 
     let result = [];