adding a context check

This commit is contained in:
tibbi 2019-05-04 18:40:10 +02:00
parent 9cc7cfc3d5
commit 44755a82f2
1 changed files with 4 additions and 0 deletions

View File

@ -312,6 +312,10 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
private fun searchFiles(text: String, path: String): ArrayList<ListItem> { private fun searchFiles(text: String, path: String): ArrayList<ListItem> {
val files = ArrayList<ListItem>() val files = ArrayList<ListItem>()
if (context == null) {
return files
}
val sorting = context!!.config.getFolderSorting(path) val sorting = context!!.config.getFolderSorting(path)
FileDirItem.sorting = context!!.config.getFolderSorting(currentPath) FileDirItem.sorting = context!!.config.getFolderSorting(currentPath)
val isSortingBySize = sorting and SORT_BY_SIZE != 0 val isSortingBySize = sorting and SORT_BY_SIZE != 0