mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-06-05 22:09:15 +02:00
adding some null checks around search
This commit is contained in:
@ -251,14 +251,14 @@ class ItemsFragment : Fragment(), ItemsAdapter.ItemOperationsListener, Breadcrum
|
|||||||
val filtered = storedItems.filter { it.name.contains(text, true) } as ArrayList
|
val filtered = storedItems.filter { it.name.contains(text, true) } as ArrayList
|
||||||
filtered.sortBy { !it.name.startsWith(text, true) }
|
filtered.sortBy { !it.name.startsWith(text, true) }
|
||||||
activity?.runOnUiThread {
|
activity?.runOnUiThread {
|
||||||
(items_list.adapter as ItemsAdapter).updateItems(filtered)
|
(items_list.adapter as? ItemsAdapter)?.updateItems(filtered)
|
||||||
}
|
}
|
||||||
}.start()
|
}.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun searchClosed() {
|
fun searchClosed() {
|
||||||
if (!skipItemUpdating) {
|
if (!skipItemUpdating) {
|
||||||
(items_list.adapter as ItemsAdapter).updateItems(storedItems)
|
(items_list.adapter as? ItemsAdapter)?.updateItems(storedItems)
|
||||||
}
|
}
|
||||||
skipItemUpdating = false
|
skipItemUpdating = false
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user