https://kotlinlang.org logo
b

bj0

01/23/2017, 9:43 PM
using an if check as @cedric shows is definitely the most readable. but you can do something like
val timer = map.get(id)?.let( if( it.finished ) null else it ) ?: MyClass.create()