mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2025-01-31 12:16:44 +01:00
fix a crash at getting selected media
This commit is contained in:
parent
ee1ec98df9
commit
b05919f7ec
1 changed files with 3 additions and 1 deletions
|
@ -331,7 +331,9 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Thumbnai
|
||||||
private fun getSelectedMedia(): List<Medium> {
|
private fun getSelectedMedia(): List<Medium> {
|
||||||
val selectedMedia = ArrayList<Medium>(selectedPositions.size)
|
val selectedMedia = ArrayList<Medium>(selectedPositions.size)
|
||||||
selectedPositions.forEach {
|
selectedPositions.forEach {
|
||||||
selectedMedia.add(media[it] as Medium)
|
(media.getOrNull(it) as? Medium)?.apply {
|
||||||
|
selectedMedia.add(this)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return selectedMedia
|
return selectedMedia
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue