Page MenuHomePhabricator

[Crash] JSONException in PageFragment.imageClicked()
Closed, ResolvedPublic1 Estimated Story Points

Description

This isn't a particularly common crash, but nevertheless it's currently the #1 unhandled crash in HockeyApp. It seems to happen when a link to an image within a page doesn't have a "title" attribute, thereby causing a JSONException.

https://rink.hockeyapp.net/manage/apps/226649/app_versions/83/crash_reasons/140957052

org.json.JSONException: No value for title
at org.json.JSONObject.get(JSONObject.java:389)
at org.json.JSONObject.getString(JSONObject.java:550)
at org.wikipedia.page.PageFragment$15.onMessage(PageFragment.java:1058)
at org.wikipedia.bridge.CommunicationBridge$2.handleMessage(CommunicationBridge.java:105)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

Event Timeline

Change 319092 had a related patch set uploaded (by Dbrant):
Fix possible crash when clicking on an image.

https://gerrit.wikimedia.org/r/319092

Change 319092 merged by jenkins-bot:
Fix possible crash when clicking on an image.

https://gerrit.wikimedia.org/r/319092

Dbrant claimed this task.