https://kotlinlang.org logo
#announcements
Title
# announcements
t

tipsy

07/28/2017, 7:19 PM
any more elegant way of handling this?
Copy code
fun uploadedFile(fileName: String): UploadedFile? {
    val uploadedFiles = uploadedFiles(fileName)
    return if (uploadedFiles.isNotEmpty()) uploadedFiles[0] else null;
}
a

agomez

07/28/2017, 7:21 PM
firstOrNull
t

tipsy

07/28/2017, 7:30 PM
perfect, thanks
2 Views