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 299821 62994b8424002efc18e8ba6b58471e051b42e930
parent 299820 7f6135916882e9dff30c5549e278f49f2fca2c17
child 299822 77fe72f30c9211b72235b099fb131bdbf98e7900
push id77701
push userkwierso@gmail.com
push dateWed, 01 Jun 2016 00:19:03 +0000
treeherdermozilla-inbound@6394d089884b [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 = [];