From 44755a82f2820b22aa1234c235f140743e758525 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 4 May 2019 18:40:10 +0200 Subject: [PATCH] adding a context check --- .../filemanager/pro/fragments/ItemsFragment.kt | 4 ++++ 1 file changed, 4 insertions(+) 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