File-Explorer icon indicating copy to clipboard operation
File-Explorer copied to clipboard

[Bug]: Crash while deleting folder

Open eirv opened this issue 2 years ago • 4 comments

What happened?

Crash trying to delete invalid UTF-8 encoded folder

What's the expected behavior?

Folder deleted successfully

What version of File Explorer you are using?

latest release (v1.1.0)

Relevant log output

java stacktrace:

java.lang.NullPointerException: Can't toast on a thread that has not called Looper.prepare()
	at com.android.internal.util.Preconditions.checkNotNull(Preconditions.java:157)
	at android.widget.Toast.getLooper(Toast.java:179)
	at android.widget.Toast.<init>(Toast.java:164)
	at android.widget.Toast.makeText(Toast.java:492)
	at android.widget.Toast.makeText(Toast.java:480)
	at com.raival.fileexplorer.App$Companion.showMsg(App.kt:37)
	at com.raival.fileexplorer.tab.file.options.FileOptionsHandler.doDelete$lambda$22(FileOptionsHandler.kt:362)
	at com.raival.fileexplorer.tab.file.options.FileOptionsHandler.$r8$lambda$cgDSyiIy_kLyXv_FGrRytZ9IV8o(Unknown Source:0)
	at com.raival.fileexplorer.tab.file.options.FileOptionsHandler$$ExternalSyntheticLambda15.run(Unknown Source:2)
	at com.raival.fileexplorer.common.BackgroundTask$run$1.invokeSuspend(BackgroundTask.kt:31)
	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:750)
	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}@b7f919b, Dispatchers.IO]

logcat:

10-12 20:01:47.848 22061 22138 W System.err: java.lang.Exception: File /storage/emulated/0/ł@л doesn't exist
10-12 20:01:47.848 22061 22138 W System.err: 	at com.raival.fileexplorer.tab.file.misc.FileUtils.deleteFile(FileUtils.kt:228)
10-12 20:01:47.848 22061 22138 W System.err: 	at com.raival.fileexplorer.tab.file.misc.FileUtils.deleteFiles(FileUtils.kt:248)
10-12 20:01:47.848 22061 22138 W System.err: 	at com.raival.fileexplorer.tab.file.options.FileOptionsHandler.doDelete$lambda$22(FileOptionsHandler.kt:359)
10-12 20:01:47.848 22061 22138 W System.err: 	at com.raival.fileexplorer.tab.file.options.FileOptionsHandler.$r8$lambda$cgDSyiIy_kLyXv_FGrRytZ9IV8o(Unknown Source:0)
10-12 20:01:47.848 22061 22138 W System.err: 	at com.raival.fileexplorer.tab.file.options.FileOptionsHandler$$ExternalSyntheticLambda15.run(Unknown Source:2)
10-12 20:01:47.848 22061 22138 W System.err: 	at com.raival.fileexplorer.common.BackgroundTask$run$1.invokeSuspend(BackgroundTask.kt:31)
10-12 20:01:47.848 22061 22138 W System.err: 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
10-12 20:01:47.848 22061 22138 W System.err: 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
10-12 20:01:47.848 22061 22138 W System.err: 	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
10-12 20:01:47.848 22061 22138 W System.err: 	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
10-12 20:01:47.848 22061 22138 W System.err: 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
10-12 20:01:47.848 22061 22138 W System.err: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
10-12 20:01:47.848 22061 22138 W System.err: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
10-12 20:01:47.848 22061 22138 W System.err: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)


### Duplicate issues

- [X] This issue has not been reported yet.

eirv avatar Oct 12 '22 12:10 eirv

How did you create that folder in first place?

Raival-e avatar Oct 13 '22 11:10 Raival-e

bash
mkdir ''$'\001\240\205''B@л'

eirv avatar Oct 13 '22 11:10 eirv

can you try to delete that folder using any other file explorer? I'm not really sure how could this problem be fixed.

Raival-e avatar Oct 13 '22 11:10 Raival-e

can you try to delete that folder using any other file explorer? I'm not really sure how could this problem be fixed.

I can use this file manager to delete. https://github.com/zhanghai/MaterialFiles

eirv avatar Oct 13 '22 12:10 eirv