adding a null check at selecting directories

This commit is contained in:
tibbi 2018-07-04 19:26:52 +02:00
parent d42e0005b5
commit 0dba5114a1
1 changed files with 5 additions and 1 deletions

View File

@ -436,7 +436,11 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
private fun getSelectedPaths(): HashSet<String> {
val paths = HashSet<String>(selectedPositions.size)
selectedPositions.forEach { paths.add(dirs[it].path) }
selectedPositions.forEach {
(dirs.getOrNull(it))?.apply {
paths.add(path)
}
}
return paths
}