If I have a nullable Boolean b, I can do the following comparison in Java:
Boolean b
Boolean b = ...; if (b != null && b) { /* Do something */
You can do with safe Operator "let"
val b: Boolean? = null b?.let { flag -> if(flag){ // true Block } else { // false Block } }