Bug 712980 - java.lang.NullPointerException @ org.mozilla.gecko.GeckoPreferences.onPreferenceChange [r=mfinkle]
authorBrad Lassey <blassey@mozilla.com>
Mon, 26 Dec 2011 10:19:27 -0500
changeset 84600 284800b71c20173e70bf33c19099fc217f5efffd
parent 84599 3b1e6033d3ff1697a64534a203eaa556a7a50d7e
child 84601 ca8dca9419fc12a5be72661f9419c10571fb4bde
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs712980
milestone12.0a1
Bug 712980 - java.lang.NullPointerException @ org.mozilla.gecko.GeckoPreferences.onPreferenceChange [r=mfinkle]
mobile/android/base/GeckoPreferences.java
--- a/mobile/android/base/GeckoPreferences.java
+++ b/mobile/android/base/GeckoPreferences.java
@@ -137,17 +137,17 @@ public class GeckoPreferences
     }
 
     final private int DIALOG_CREATE_MASTER_PASSWORD = 0;
     final private int DIALOG_REMOVE_MASTER_PASSWORD = 1;
 
     @Override
     public boolean onPreferenceChange(Preference preference, Object newValue) {
         String prefName = preference.getKey();
-        if (prefName.equals("privacy.masterpassword.enabled")) {
+        if (prefName != null && prefName.equals("privacy.masterpassword.enabled")) {
             showDialog((Boolean)newValue ? DIALOG_CREATE_MASTER_PASSWORD : DIALOG_REMOVE_MASTER_PASSWORD);
             return false;
         }
 
         setPreference(prefName, newValue);
         if (preference instanceof ListPreference) {
             // We need to find the entry for the new value
             int newIndex = ((ListPreference)preference).findIndexOfValue((String) newValue);