TeamAmaze / TeamAmaze/AmazeFileManager

NPE on `HybridFile#isDirectory`

Open
#3,455 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

From-telegram 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)

Hope this helps & is in the correct place

Exception

  • App Name: Amaze File Manager
  • Package: com.amaze.filemanager
  • Version: 3.7.2
  • User Action: UI Error
  • Request: Application crash
  • OS: Linux Android 11 - 30
  • Device: a03su
  • Model: SM-S134DL
  • Product: a03sutfn
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 android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
 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 'boolean androidx.documentfile.provider.DocumentFile.isDirectory()' on a null object reference
 at com.amaze.filemanager.filesystem.HybridFile.isDirectory(HybridFile.java:579)
 at com.amaze.filemanager.filesystem.files.FileUtils.getBaseFileSize(FileUtils.java:206)
 at com.amaze.filemanager.filesystem.files.FileUtils.getTotalBytes(FileUtils.java:200)
 at com.amaze.filemanager.asynchronous.services.CopyService$DoInBackground.doInBackground(CopyService.java:251)
 at com.amaze.filemanager.asynchronous.services.CopyService$DoInBackground.doInBackground(CopyService.java:234)
 at android.os.AsyncTask$3.call(AsyncTask.java:394)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 ... 4 more


Reporter: via80hd

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 at HybridFile.isDirectory in the reported HybridFile.java:579 location, then trace the callers in FileUtils.java:200-206 and CopyService.java:234-251. Run the relevant Android file-copy flow or tests if available and determine the conditions that leave DocumentFile null. Done means the reported copy path no longer crashes and the behavior for that file state is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.