Skip to content

Commit 5215451

Browse files
committed
improve OTG file fetching
1 parent 174d55e commit 5215451

File tree

1 file changed

+5
-4
lines changed
  • app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments

1 file changed

+5
-4
lines changed

app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/ItemsFragment.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,13 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
174174
skipItemUpdating = false
175175
Thread {
176176
if (activity?.isDestroyed == false && activity?.isFinishing == false) {
177-
if (context!!.isPathOnOTG(path)) {
178-
val getProperFileSize = context!!.config.sorting and SORT_BY_SIZE != 0
179-
context!!.getOTGItems(path, context!!.config.shouldShowHidden, getProperFileSize) {
177+
val config = context!!.config
178+
if (context!!.isPathOnOTG(path) && config.OTGTreeUri.isNotEmpty()) {
179+
val getProperFileSize = config.sorting and SORT_BY_SIZE != 0
180+
context!!.getOTGItems(path, config.shouldShowHidden, getProperFileSize) {
180181
callback(path, getListItemsFromFileDirItems(it))
181182
}
182-
} else if (!context!!.config.enableRootAccess || !context!!.isPathOnRoot(path)) {
183+
} else if (!config.enableRootAccess || !context!!.isPathOnRoot(path)) {
183184
getRegularItemsOf(path, callback)
184185
} else {
185186
RootHelpers(activity!!).getFiles(path, callback)

0 commit comments

Comments
 (0)