adding a null check at deleting files
This commit is contained in:
parent
8603661873
commit
25b31eb5a7
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue