fix a crash at getting selected media

This commit is contained in:
tibbi 2018-07-01 11:40:42 +02:00
parent ee1ec98df9
commit b05919f7ec
1 changed files with 3 additions and 1 deletions

View File

@ -331,7 +331,9 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Thumbnai
private fun getSelectedMedia(): List<Medium> {
val selectedMedia = ArrayList<Medium>(selectedPositions.size)
selectedPositions.forEach {
selectedMedia.add(media[it] as Medium)
(media.getOrNull(it) as? Medium)?.apply {
selectedMedia.add(this)
}
}
return selectedMedia
}