okkero
11/30/2016, 12:41 PMBoolean? and you want the function to return someNonNullObj if someObj is true, and null if it is false or null then maybe something like the following:
fun foo(): Any? {
return someObj?.let {
if (it) someNonNullObj else null
} ?: null
}