Closed Bug 722655 Opened 12 years ago Closed 12 years ago

Crash on about:home if tab title is not defined

Categories

(Firefox for Android Graveyard :: General, defect, P2)

ARM
Android
defect

Tracking

(firefox11 fixed, firefox12 fixed, firefox13 verified, fennec+)

VERIFIED FIXED
Firefox 13
Tracking Status
firefox11 --- fixed
firefox12 --- fixed
firefox13 --- verified
fennec + ---

People

(Reporter: lucasr, Assigned: lucasr)

Details

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

Attachments

(1 file)

01-30 14:38:45.974: ERROR/GeckoAboutHome(27190): error reading json file
01-30 14:38:45.974: ERROR/GeckoAboutHome(27190): org.json.JSONException: No value for title
01-30 14:38:45.974: ERROR/GeckoAboutHome(27190):     at org.json.JSONObject.get(JSONObject.java:354)
01-30 14:38:45.974: ERROR/GeckoAboutHome(27190):     at org.json.JSONObject.getString(JSONObject.java:510)
01-30 14:38:45.974: ERROR/GeckoAboutHome(27190):     at org.mozilla.gecko.AboutHomeContent.readLastTabs(AboutHomeContent.java:506)
01-30 14:38:45.974: ERROR/GeckoAboutHome(27190):     at org.mozilla.gecko.AboutHomeContent.access$400(AboutHomeContent.java:91)
01-30 14:38:45.974: ERROR/GeckoAboutHome(27190):     at org.mozilla.gecko.AboutHomeContent$5$2.run(AboutHomeContent.java:294)
01-30 14:38:45.974: ERROR/GeckoAboutHome(27190):     at android.os.Handler.handleCallback(Handler.java:587)
01-30 14:38:45.974: ERROR/GeckoAboutHome(27190):     at android.os.Handler.dispatchMessage(Handler.java:92)
01-30 14:38:45.974: ERROR/GeckoAboutHome(27190):     at android.os.Looper.loop(Looper.java:130)
01-30 14:38:45.974: ERROR/GeckoAboutHome(27190):     at org.mozilla.gecko.GeckoAppShell$LooperThread.run(GeckoAppShell.java:185)
01-30 14:38:45.974: ERROR/GeckoAboutHome(27190): error reading json file
01-30 14:38:45.974: ERROR/GeckoAboutHome(27190): org.json.JSONException: No value for title
01-30 14:38:45.974: ERROR/GeckoAboutHome(27190):     at org.json.JSONObject.get(JSONObject.java:354)
01-30 14:38:45.974: ERROR/GeckoAboutHome(27190):     at org.json.JSONObject.getString(JSONObject.java:510)
01-30 14:38:45.974: ERROR/GeckoAboutHome(27190):     at org.mozilla.gecko.AboutHomeContent.readLastTabs(AboutHomeContent.java:506)
01-30 14:38:45.974: ERROR/GeckoAboutHome(27190):     at org.mozilla.gecko.AboutHomeContent.access$400(AboutHomeContent.java:91)
01-30 14:38:45.974: ERROR/GeckoAboutHome(27190):     at org.mozilla.gecko.AboutHomeContent$5$2.run(AboutHomeContent.java:294)
01-30 14:38:45.974: ERROR/GeckoAboutHome(27190):     at android.os.Handler.handleCallback(Handler.java:587)
01-30 14:38:45.974: ERROR/GeckoAboutHome(27190):     at android.os.Handler.dispatchMessage(Handler.java:92)
01-30 14:38:45.974: ERROR/GeckoAboutHome(27190):     at android.os.Looper.loop(Looper.java:130)
01-30 14:38:45.974: ERROR/GeckoAboutHome(27190):     at org.mozilla.gecko.GeckoAppShell$LooperThread.run(GeckoAppShell.java:185)
Severity: normal → critical
Keywords: crash, reproducible
Hardware: All → ARM
Whiteboard: [native-crash]
Attachment #593039 - Flags: review?(mark.finkle)
Comment on attachment 593039 [details] [diff] [review]
Fix crash on about:home when tab isn't present

>-                title = entry.getString("title");
>                 url = entry.getString("url");
>+
>+                String optTitle = entry.optString("title");
>+                if (TextUtils.isEmpty(optTitle))
>+                    title = url;
>+                else
>+                    title = optTitle;


Why use "optTitle"? Can't you just use:

>                 title = entry.optString("title");
>+                if (TextUtils.isEmpty(title))
>+                    title = url;

r+, but drop optTitle if reasonable
Attachment #593039 - Flags: review?(mark.finkle) → review+
Comment on attachment 593039 [details] [diff] [review]
Fix crash on about:home when tab isn't present

Fixes a potential crash in about:home. Non-risky.
Attachment #593039 - Flags: approval-mozilla-aurora?
Attachment #593039 - Flags: approval-mozilla-beta?
tracking-fennec: --- → +
Priority: -- → P2
https://hg.mozilla.org/mozilla-central/rev/2d01f8d3f6a8
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 13
Comment on attachment 593039 [details] [diff] [review]
Fix crash on about:home when tab isn't present

[Triage Comment]
Mobile only - approved for Aurora 12 and Beta 11.
Attachment #593039 - Flags: approval-mozilla-beta?
Attachment #593039 - Flags: approval-mozilla-beta+
Attachment #593039 - Flags: approval-mozilla-aurora?
Attachment #593039 - Flags: approval-mozilla-aurora+
Verified fixed on:

Firefox 13.0a1 (2012-02-28)
20120228031102
http://hg.mozilla.org/mozilla-central/rev/7ce4d9b55863

--
Device: Samsung Galaxy S2
OS: Android 2.3.4
Status: RESOLVED → VERIFIED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: