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 338656 62994b8424002efc18e8ba6b58471e051b42e930
parent 338655 7f6135916882e9dff30c5549e278f49f2fca2c17
child 338657 77fe72f30c9211b72235b099fb131bdbf98e7900
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [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 = [];