Skip to content

Commit 193091f

Browse files
committed
adding a null check at getting files
1 parent 69f091d commit 193091f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/src/main/kotlin/com/simplemobiletools/filemanager/fragments/ItemsFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ class ItemsFragment : Fragment(), ItemsAdapter.ItemOperationsListener, Breadcrum
184184

185185
private fun getRegularItemsOf(path: String, callback: (items: ArrayList<FileDirItem>) -> Unit) {
186186
val items = ArrayList<FileDirItem>()
187-
val files = File(path).listFiles()
187+
val files = File(path).listFiles()?.filterNotNull()
188188
if (files != null) {
189189
for (file in files) {
190190
val curPath = file.absolutePath

0 commit comments

Comments
 (0)