paulblessing
02/16/2018, 2:54 PM?.let { ... } ?: ...
.
val foo: String? = null
val bar = foo?.let { thingThatCouldReturnNull() } ?: "Hello"
val baz = if (foo == null) thingThatCouldReturnNull() else "Hello"
println(bar) // prints "Hello" if thingThatCouldReturnNull() returns null
println(baz) // prints "null" if thingThatCouldReturnNull() returns null