Any way how I can write this more elegantly? `val ...
# getting-started
e
Any way how I can write this more elegantly?
val errors = if (torrent.error != null) listOf(torrent.error) else null
I did find
val errors = listOfNotNull(torrent.error)
but that gives and empty list instead of
null
.