Bernhard
08/21/2024, 7:49 PMYoussef Shoaib [MOD]
08/21/2024, 9:58 PMnullable
blocksStephan Schröder
08/21/2024, 10:05 PM?.
more often!?
bob?.department?.head?.name?.let { name: String -> ... }
https://kotlinlang.org/docs/null-safety.html#safe-calls
also check your domain models, maybe they contain more nullable properties if they need to.CLOVIS
08/22/2024, 7:33 AMval result = foo
?.let { a -> b(a) }
?.let { b -> c(b) }
?.let { c -> d(c) }
becomes
val result = nullable {
val b = b(foo).bind()
val c = c(b).bind()
d(c)
}
Bernhard
08/22/2024, 8:01 AM