Bug 710697 - LinkPreference causes a null preference to be sent to Gecko [r=mbrubeck a=android-only]
authorMark Finkle <mfinkle@mozilla.com>
Wed, 14 Dec 2011 16:36:27 -0500
changeset 84231 b0213baf29050f71710bd040e93daa86b517f3f3
parent 84230 99dedca7064e537ed2830b0ffe24ee899a483aaf
child 84232 5ef118dcf1a1455b0b2d0e0f78ad78c0d42fc458
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck, android-only
bugs710697
milestone11.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 710697 - LinkPreference causes a null preference to be sent to Gecko [r=mbrubeck a=android-only]
mobile/android/base/GeckoPreferences.java
--- a/mobile/android/base/GeckoPreferences.java
+++ b/mobile/android/base/GeckoPreferences.java
@@ -191,16 +191,19 @@ public class GeckoPreferences
             }
         } catch (JSONException e) {
             Log.e(LOGTAG, "Problem parsing preferences response: ", e);
         }
     }
 
     // send the Preferences:Set message to Gecko
     public static void setPreference(String pref, Object value) {
+        if (pref == null || pref.length() == 0)
+            return;
+
         try {
             JSONObject jsonPref = new JSONObject();
             jsonPref.put("name", pref);
             if (value instanceof Boolean) {
                 jsonPref.put("type", "bool");
                 jsonPref.put("value", ((Boolean)value).booleanValue());
             }
             else if (value instanceof Integer) {