make sure we dont trim out the slash of root folder

This commit is contained in:
tibbi 2017-10-02 21:11:47 +02:00
parent b8c1e9bdfb
commit b35a8a74a0
1 changed files with 4 additions and 1 deletions

View File

@ -190,7 +190,10 @@ class ItemsFragment : Fragment(), ItemsAdapter.ItemOperationsListener {
} }
private fun getRootItemsOf(path: String, callback: (items: ArrayList<FileDirItem>) -> Unit) { private fun getRootItemsOf(path: String, callback: (items: ArrayList<FileDirItem>) -> Unit) {
RootHelpers().getFiles(activity as SimpleActivity, path.trimEnd('/'), callback) var wantedPath = path.trimEnd('/')
if (wantedPath.isEmpty())
wantedPath = "/"
RootHelpers().getFiles(activity as SimpleActivity, wantedPath, callback)
} }
private fun getChildren(file: File): Int { private fun getChildren(file: File): Int {