Closed Bug 712980 Opened 8 years ago Closed 8 years ago

java.lang.NullPointerException @ org.mozilla.gecko.GeckoPreferences.onPreferenceChange(GeckoPreferences.java:145)

Categories

(Firefox for Android :: General, defect, P3, critical)

ARM
Android
defect

Tracking

()

VERIFIED FIXED
Firefox 11
Tracking Status
firefox11 --- verified
firefox12 --- verified
fennec 11+ ---

People

(Reporter: aaronmt, Assigned: blassey)

References

Details

(Keywords: crash, reproducible, Whiteboard: [native-crash])

Crash Data

Attachments

(1 file, 1 obsolete file)

E/GeckoApp(  989): top level exception
E/GeckoApp(  989): java.lang.NullPointerException
E/GeckoApp(  989): 	at org.mozilla.gecko.GeckoPreferences.onPreferenceChange(GeckoPreferences.java:145)
E/GeckoApp(  989): 	at android.preference.Preference.callChangeListener(Preference.java:756)
E/GeckoApp(  989): 	at org.mozilla.gecko.LinkPreference.onClick(LinkPreference.java:59)
E/GeckoApp(  989): 	at android.preference.Preference.performClick(Preference.java:810)
E/GeckoApp(  989): 	at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:190)
E/GeckoApp(  989): 	at android.widget.AdapterView.performItemClick(AdapterView.java:284)
E/GeckoApp(  989): 	at android.widget.ListView.performItemClick(ListView.java:3513)
E/GeckoApp(  989): 	at android.widget.AbsListView$PerformClick.run(AbsListView.java:1812)
E/GeckoApp(  989): 	at android.os.Handler.handleCallback(Handler.java:587)
E/GeckoApp(  989): 	at android.os.Handler.dispatchMessage(Handler.java:92)
E/GeckoApp(  989): 	at android.os.Looper.loop(Looper.java:130)
E/GeckoApp(  989): 	at org.mozilla.gecko.GeckoApp$33.run(GeckoApp.java:1517)
E/GeckoApp(  989): 	at android.os.Handler.handleCallback(Handler.java:587)
E/GeckoApp(  989): 	at android.os.Handler.dispatchMessage(Handler.java:92)
E/GeckoApp(  989): 	at android.os.Looper.loop(Looper.java:130)
E/GeckoApp(  989): 	at android.app.ActivityThread.main(ActivityThread.java:3683)
E/GeckoApp(  989): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/GeckoApp(  989): 	at java.lang.reflect.Method.invoke(Method.java:507)
E/GeckoApp(  989): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/GeckoApp(  989): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/GeckoApp(  989): 	at dalvik.system.NativeStart.main(Native Method)

STR:
1. Settings -> About Nightly

--
Samsung Galaxy SII (Android 2.3.4)
20111222081210
http://hg.mozilla.org/integration/mozilla-inbound/rev/6707b2415598
Assignee: nobody → wjohnston
Priority: -- → P3
Attached patch patch (obsolete) — Splinter Review
Assignee: wjohnston → blassey.bugs
Attachment #584302 - Flags: review?(mark.finkle)
Comment on attachment 584302 [details] [diff] [review]
patch


>diff --git a/mobile/android/base/GeckoPreferences.java b/mobile/android/base/GeckoPreferences.java

Some of our preferences do not have a prefName (key) so this would short-circuit some logic.

>     public boolean onPreferenceChange(Preference preference, Object newValue) {
>+        if (preference == null)
>+            return false;

This should never happen, but we can keep it

>+        if (prefName == null)
>+            return false;

This isn't quite right. Let's not do it. Maybe we could add a comment that prefName can be NULL ?

>         if (prefName.equals("privacy.masterpassword.enabled")) {

          if (prefName != null && prefName.equals("privacy.masterpassword.enabled")) {

This should be enough to fix the problem, right?
Attachment #584302 - Flags: review?(mark.finkle) → review-
Duplicate of this bug: 713513
Attached patch patchSplinter Review
Attachment #584302 - Attachment is obsolete: true
Attachment #584326 - Flags: review?(mark.finkle)
Attachment #584326 - Flags: review?(mark.finkle) → review+
Comment on attachment 584326 [details] [diff] [review]
patch

crash fix
Attachment #584326 - Flags: approval-mozilla-aurora?
https://hg.mozilla.org/mozilla-central/rev/284800b71c20
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 12
Comment on attachment 584326 [details] [diff] [review]
patch

[triage comment]
Approved for aurora. Mobile only, fixes a crash with easy STR.
Attachment #584326 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Samsung Galaxy SII (Android 2.3.4)
Mozilla/5.0 (Android; Linux armv7l; rv:12.0a1) Gecko/20111228 Firefox/12.0a1 Fennec/12.0a1
Mozilla/5.0 (Android; Linux armv7l; rv:11.0a2) Gecko/20111228 Firefox/11.0a2 Fennec/11.0a1
Status: RESOLVED → VERIFIED
tracking-fennec: --- → 11+
You need to log in before you can comment on or make changes to this bug.