adding a null check at getting files

This commit is contained in:
tibbi
2017-12-28 11:05:28 +01:00
parent 69f091dbbe
commit 193091fb46

View File

@ -184,7 +184,7 @@ class ItemsFragment : Fragment(), ItemsAdapter.ItemOperationsListener, Breadcrum
private fun getRegularItemsOf(path: String, callback: (items: ArrayList<FileDirItem>) -> Unit) {
val items = ArrayList<FileDirItem>()
val files = File(path).listFiles()
val files = File(path).listFiles()?.filterNotNull()
if (files != null) {
for (file in files) {
val curPath = file.absolutePath