From 071794a693824a87c2c380a9ae780fb400216ef6 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 1 Jul 2018 23:49:18 +0200 Subject: [PATCH] add an extra check to avoid deleting folders from viewpageractivity --- .../simplemobiletools/gallery/activities/ViewPagerActivity.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 5b937556a..8e356ef2b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -933,6 +933,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun deleteConfirmed() { val path = getCurrentMedia().getOrNull(mPos)?.path ?: return + if (getIsPathDirectory(path)) { + return + } + val fileDirItem = FileDirItem(path, path.getFilenameFromPath()) if (config.useRecycleBin && !getCurrentMedium()!!.getIsInRecycleBin()) { movePathsInRecycleBin(arrayListOf(path)) {