TeamAmaze / TeamAmaze/AmazeFileManager

NPE on OTGUtil.getDocumentFiles when listing otg files

Open
#2,433 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Environment-API30 From-Email Issue-Bug
Dominant language
Kotlin
Stars
6.4k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
1

Description

Issue explanation (write below this line)

Exception

  • User Action: UI Error
  • Request: Application crash
  • Version: 3.5.3
  • OS: Linux Android 11 - 30
  • Device: bramble
  • Model: Pixel 4a (5G)
  • Product: bramble
Crash log

java.lang.RuntimeException: An error occurred while executing
doInBackground()
at android.os.AsyncTask$4.done(AsyncTask.java:415)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method
'androidx.documentfile.provider.DocumentFile[]
androidx.documentfile.provider.DocumentFile.listFiles()' on a null object
reference
at com.amaze.filemanager.utils.OTGUtil.getDocumentFiles(OTGUtil.java:97)
at
com.amaze.filemanager.asynchronous.asynctasks.LoadFilesListTask.listOtg(LoadFilesListTask.java:491)
at
com.amaze.filemanager.asynchronous.asynctasks.LoadFilesListTask.doInBackground(LoadFilesListTask.java:185)
at
com.amaze.filemanager.asynchronous.asynctasks.LoadFilesListTask.doInBackground(LoadFilesListTask.java:67)
at android.os.AsyncTask$3.call(AsyncTask.java:394)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
... 3 more


.:.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading OTGUtil.getDocumentFiles in OTGUtil.java at line 97 and the call from LoadFilesListTask.listOtg at line 491. Reproduce or trace OTG file listing on Android 11, then determine the expected handling when the DocumentFile reference is null. Done means listing OTG files no longer crashes with this NullPointerException.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.