diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/ItemsFragment.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/ItemsFragment.kt index c6d1a7bf..16e7dcce 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/ItemsFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/ItemsFragment.kt @@ -312,6 +312,10 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb private fun searchFiles(text: String, path: String): ArrayList { val files = ArrayList() + if (context == null) { + return files + } + val sorting = context!!.config.getFolderSorting(path) FileDirItem.sorting = context!!.config.getFolderSorting(currentPath) val isSortingBySize = sorting and SORT_BY_SIZE != 0