NPE for uriString

Bug #1331590 reported by pjv
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Collectionista
New
Undecided
Unassigned

Bug Description

Bugsense:
https://www.bugsense.com/dashboard/project/98c9e403/errors/824298064
https://www.bugsense.com/dashboard/project/98c9e403/errors/881278031

java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:200)
at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
at java.lang.Thread.run(Thread.java:1019)Caused by: java.lang.NullPointerException: uriString
at android.net.Uri$StringUri.(Uri.java:420)
at android.net.Uri$StringUri.(Uri.java:410)
at android.net.Uri.parse(Uri.java:382)
at net.lp.collectionista.util.tasks.MusicCDItemScanAddTask.net.lp.collectionista.domain.Product doInBackground(java.lang.String[])(Collectionista:1)
at net.lp.collectionista.util.tasks.ScanAddTask.java.lang.Object doInBackground(java.lang.Object[])(Collectionista:1)
at android.os.AsyncTask$2.call(AsyncTask.java:185)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
... 4 more

also similar in BookItemScanAddTask

Related branches

Revision history for this message
pjv (pjv) wrote :

Added an error in multiple places when we suspect uriOfCollectionString is null, to find bugs easier in the future. Not fixed yet.

Also think of other places next (sheetmusic, ...) next.

Revision history for this message
pjv (pjv) wrote :

better stacktrace now: https://www.bugsense.com/dashboard/project/98c9e403/errors/1293148243

only in MusicCD- and Book-ItemScanAddTask.

Revision history for this message
pjv (pjv) wrote :

java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:200)
at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
at java.lang.Thread.run(Thread.java:1019)Caused by: java.lang.IllegalArgumentException: uriOfCollectionString is null in doInBackground. (lp:1331590)
at net.lp.collectionista.util.tasks.BookItemScanAddTask.net.lp.collectionista.domain.Product doInBackground(java.lang.String[])(Collectionista:1)
at net.lp.collectionista.util.tasks.ScanAddTask.java.lang.Object doInBackground(java.lang.Object[])(Collectionista:1)
at android.os.AsyncTask$2.call(AsyncTask.java:185)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
... 4 more

Revision history for this message
pjv (pjv) wrote :

It is null because it is not restored with the task in restart(). Fixed that. Also improved existsProduct().

No other task have same problem.

Was under radar because of inspection used with restart. Should always save and restore all fields of any task child class.

TODO still: improve NPE checks or remove, when fix is seen to be working completely.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.