From 41d2f5b7b7062ef7cd092cd441b2d1c37bac0faa Mon Sep 17 00:00:00 2001 From: Yogesh Khatri Date: Sat, 4 Sep 2021 11:20:16 +1000 Subject: [PATCH] Fix DoesFolderExist(path) bug if path ends in / --- plugins/helpers/apfs_reader.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/helpers/apfs_reader.py b/plugins/helpers/apfs_reader.py index 2961a28..aa621c9 100644 --- a/plugins/helpers/apfs_reader.py +++ b/plugins/helpers/apfs_reader.py @@ -1150,6 +1150,8 @@ def DoesFileExist(self, path): def DoesFolderExist(self, path): '''Returns True if folder exists''' + if path != '/' and path.endswith('/'): + path = path[:-1] apfs_file_meta = self.GetApfsFileMeta(path) if apfs_file_meta: return apfs_file_meta.item_type in (4, 10) # will also return true for symlink which may point to file!