adding a null check at deleting files

This commit is contained in:
tibbi 2017-05-19 20:57:58 +02:00
parent 8603661873
commit 25b31eb5a7

View file

@ -230,6 +230,9 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
private fun getCurrentFile() = File(media[selectedPositions.first()].path) private fun getCurrentFile() = File(media[selectedPositions.first()].path)
private fun deleteFiles() { private fun deleteFiles() {
if (selectedPositions.isEmpty())
return
val files = ArrayList<File>(selectedPositions.size) val files = ArrayList<File>(selectedPositions.size)
val removeMedia = ArrayList<Medium>(selectedPositions.size) val removeMedia = ArrayList<Medium>(selectedPositions.size)