In Kotlin, what is the idiomatic way to deal with nullable values, referencing or converting them

If I have a nullable type Xyz?, I want to reference it or convert it to a non-nullable type Xyz. What is the idiomatic way of doing so in Kotlin? For example, this code is in error: val something: Xyz? = createPossiblyNullXyz() something.foo() // Error: “Only safe (?.) or non-null asserted (!!.) calls are allowed … Read more