Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NullPointerException in Rendering task #142

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

sonique6784
Copy link

Hi,
here is a patch to prevent the library to crash when renderingTask is null.
I also replace "isEmpty()" and "get(0)", by an iterator.
I added some test != null to prevent any crash.

Here is the Exception: java.lang.NullPointerException: Attempt to read from field 'int com.joanzapata.pdfview.e$a.d' on a null object reference

Thank you
Cedric

PS: can you please keep up to date the maven repo so we can get the latest version through gradle ? thanks a lot

full stack below :

java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:304)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.NullPointerException: Attempt to read from field 'int com.joanzapata.pdfview.e$a.d' on a null object reference
at com.joanzapata.pdfview.RenderingAsyncTask.proceed(RenderingAsyncTask.java:100)
at com.joanzapata.pdfview.RenderingAsyncTask.doInBackground(RenderingAsyncTask.java:33)
at android.os.AsyncTask$2.call(AsyncTask.java:292)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)

Hi,
here is a patch to prevent the library to crash when renderingTask is null.
I also replace "isEmpty()" and "get(0)", by an iterator.
I added some test != null to prevent any crash.

Here is the Exception: java.lang.NullPointerException: Attempt to read from field 'int com.joanzapata.pdfview.e$a.d' on a null object reference

Thank you
Cedric

PS: can you please keep up to date the maven repo so we can get the latest version through gradle ? thanks a lot

full stack below :

java.lang.RuntimeException: An error occured while executing doInBackground()
       at android.os.AsyncTask$3.done(AsyncTask.java:304)
       at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
       at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
       at java.util.concurrent.FutureTask.run(FutureTask.java:242)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
       at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.NullPointerException: Attempt to read from field 'int com.joanzapata.pdfview.e$a.d' on a null object reference
       at com.joanzapata.pdfview.RenderingAsyncTask.proceed(RenderingAsyncTask.java:100)
       at com.joanzapata.pdfview.RenderingAsyncTask.doInBackground(RenderingAsyncTask.java:33)
       at android.os.AsyncTask$2.call(AsyncTask.java:292)
       at java.util.concurrent.FutureTask.run(FutureTask.java:237)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
       at java.lang.Thread.run(Thread.java:818)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant