Page MenuHomePhabricator

App crashes if you open a non-existing page
Closed, ResolvedPublic

Description

Crash report:

USER_COMMENT=I just opened a nonexisting article from browser
ANDROID_VERSION=4.0.4
APP_VERSION_NAME=1.0-SNAPSHOT
BRAND=htc_europe
PHONE_MODEL=HTC Desire S
CUSTOM_DATA=
STACK_TRACE=java.lang.RuntimeException: java.lang.NullPointerException
at org.wikipedia.page.PageViewFragment$LeadSectionFetchTask.onCatch(PageViewFragment.java:267)
at org.wikipedia.concurrency.SaneAsyncTask$BackingAsyncTask.onPostExecute(SaneAsyncTask.java:96)
at android.os.AsyncTask.finish(AsyncTask.java:602)
at android.os.AsyncTask.access$600(AsyncTask.java:156)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:615)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4945)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at org.wikipedia.page.PageViewFragment$LeadSectionFetchTask.processResult(PageViewFragment.java:241)
at org.wikipedia.page.PageViewFragment$LeadSectionFetchTask.processResult(PageViewFragment.java:224)
at org.wikipedia.ApiTask.performTask(ApiTask.java:19)
at org.wikipedia.concurrency.SaneAsyncTask$BackingAsyncTask.doInBackground(SaneAsyncTask.java:85)
at org.wikipedia.concurrency.SaneAsyncTask$BackingAsyncTask.doInBackground(SaneAsyncTask.java:79)
at android.os.AsyncTask$2.call(AsyncTask.java:264)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:137)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:137)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:150)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:864)
java.lang.NullPointerException
at org.wikipedia.page.PageViewFragment$LeadSectionFetchTask.processResult(PageViewFragment.java:241)
at org.wikipedia.page.PageViewFragment$LeadSectionFetchTask.processResult(PageViewFragment.java:224)
at org.wikipedia.ApiTask.performTask(ApiTask.java:19)
at org.wikipedia.concurrency.SaneAsyncTask$BackingAsyncTask.doInBackground(SaneAsyncTask.java:85)
at org.wikipedia.concurrency.SaneAsyncTask$BackingAsyncTask.doInBackground(SaneAsyncTask.java:79)
at android.os.AsyncTask$2.call(AsyncTask.java:264)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:137)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:137)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:150)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:864)


Version: Android (alpha)
Severity: normal

Details

Reference
bz62639

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:09 AM
bzimport set Reference to bz62639.
bzimport added a subscriber: Unknown Object (MLST).

I ran into the same issue. I clicked a link from Notification email, and the link handler gave me the option to use the app. But when I opened it in the app it immediately crashed. I realized after opening the link in the browser instead that the page linked from the email had been moved with no redirect.

I guess a simple 'this page does not exist yet :(' message would do?

It may be essentially the same issue, but the app also crashes on any non-article page that doesn't have a mobile view. This includes most special pages, and pages in the Education_Program namespace.

A different message would be needed in those cases, since the problem is not that pages don't exist.

kwang wrote:

Yes. We are working on this in the next 2 weeks.

Change 130213 had a related patch set uploaded by Dbrant:
Fixed crash on nonexistent and Special pages (pages with no mobile view)

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

Change 130226 had a related patch set uploaded by Dbrant:
Fixed crash on nonexistent pages.

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

Change 130226 merged by jenkins-bot:
Fixed crash on nonexistent pages.

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

Change 130213 abandoned by Dbrant:
Fixed crash on nonexistent and Special pages (pages with no mobile view)

Reason:
easier to create a new patch.

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

Resolved the latest build, but see bug 64691 related to the way it was resolved.