TeamAmaze / TeamAmaze/AmazeFileManager

NPE on `TrashBinMetadata#getFilesWithDeletionCriteria`

Open
#4,096 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Trash Crash-NullPointerException 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)

Deleting certain folders, seemingly ones other apps use or need some permission to manage like dcim, where camera app saves it's photoes, produces this error.

Exception

  • App Name: Amaze File Manager
  • Package: com.amaze.filemanager
  • Version: 3.10
  • User Action: UI Error
  • Request: Application crash
  • OS: Linux motorola/milan_g/milan:12/S3RDE32.123-37-5/1efeef:user/release-keys 12 - 31
  • Device: milan
  • Model: moto g stylus (2022)
  • Product: milan_g
Crash log

java.lang.NullPointerException: Attempt to invoke interface method 'int java.util.List.size()' on a null object reference
	at com.amaze.trashbin.TrashBinMetadata.getFilesWithDeletionCriteria(TrashBinMetadata.kt:54)
	at com.amaze.trashbin.TrashBin.triggerCleanup(TrashBin.kt:262)
	at com.amaze.trashbin.TrashBin$1.invokeSuspend(TrashBin.kt:78)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@7f74098, Dispatchers.IO]


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 com.amaze.trashbin.TrashBinMetadata.getFilesWithDeletionCriteria in TrashBinMetadata.kt:54, then follow the cleanup call from TrashBin.kt:262. Reproduce cleanup while deleting folders such as dcim and inspect why the file list is null. Done means this scenario no longer crashes with a NullPointerException.

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
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.