mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-06-05 22:09:15 +02:00
adding a null check at getting files
This commit is contained in:
@ -184,7 +184,7 @@ class ItemsFragment : Fragment(), ItemsAdapter.ItemOperationsListener, Breadcrum
|
|||||||
|
|
||||||
private fun getRegularItemsOf(path: String, callback: (items: ArrayList<FileDirItem>) -> Unit) {
|
private fun getRegularItemsOf(path: String, callback: (items: ArrayList<FileDirItem>) -> Unit) {
|
||||||
val items = ArrayList<FileDirItem>()
|
val items = ArrayList<FileDirItem>()
|
||||||
val files = File(path).listFiles()
|
val files = File(path).listFiles()?.filterNotNull()
|
||||||
if (files != null) {
|
if (files != null) {
|
||||||
for (file in files) {
|
for (file in files) {
|
||||||
val curPath = file.absolutePath
|
val curPath = file.absolutePath
|
||||||
|
Reference in New Issue
Block a user