Last Comment Bug 722655 - Crash on about:home if tab title is not defined
: Crash on about:home if tab title is not defined
Status: VERIFIED FIXED
[native-crash]
: crash, reproducible
Product: Firefox for Android
Classification: Client Software
Component: General (show other bugs)
: Trunk
: ARM Android
: P2 critical (vote)
: Firefox 13
Assigned To: Lucas Rocha (:lucasr)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-31 03:46 PST by Lucas Rocha (:lucasr)
Modified: 2012-02-29 02:43 PST (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
fixed
fixed
verified
+


Attachments
Fix crash on about:home when tab isn't present (2.09 KB, patch)
2012-01-31 04:12 PST, Lucas Rocha (:lucasr)
mark.finkle: review+
akeybl: approval‑mozilla‑aurora+
akeybl: approval‑mozilla‑beta+
Details | Diff | Review

Description Lucas Rocha (:lucasr) 2012-01-31 03:46:12 PST
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)
Comment 1 Lucas Rocha (:lucasr) 2012-01-31 04:12:37 PST
Created attachment 593039 [details] [diff] [review]
Fix crash on about:home when tab isn't present
Comment 2 Mark Finkle (:mfinkle) (use needinfo?) 2012-01-31 06:40:25 PST
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
Comment 3 Lucas Rocha (:lucasr) 2012-02-02 07:55:08 PST
Pushed: http://hg.mozilla.org/integration/mozilla-inbound/rev/2d01f8d3f6a8
Comment 4 Lucas Rocha (:lucasr) 2012-02-02 07:56:00 PST
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.
Comment 5 Ed Morley [:emorley] 2012-02-03 11:41:12 PST
https://hg.mozilla.org/mozilla-central/rev/2d01f8d3f6a8
Comment 6 Alex Keybl [:akeybl] 2012-02-05 13:44:12 PST
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.
Comment 7 Mark Finkle (:mfinkle) (use needinfo?) 2012-02-06 12:29:09 PST
https://hg.mozilla.org/releases/mozilla-aurora/rev/4e7107d35192
Comment 8 Brad Lassey [:blassey] (use needinfo?) 2012-02-06 14:00:02 PST
https://hg.mozilla.org/releases/mozilla-beta/rev/66bf4724d9bc
Comment 9 Cristian Nicolae (:xti) 2012-02-29 02:43:58 PST
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

Note You need to log in before you can comment on or make changes to this bug.