Using Boolean? in if conditional expression in Kotlin
Hi everyone! I just started learning Kotlin after Java, and I ran into a problem that I can't figure out.\n\nI have a nullable variable `isActive: Boolean?`, which can be `true`, `false`, or `null`. I want to check it in an `if` condition:\n\n```kotlin\nvar isActive: Boolean? = null\n\nif (isActive) {\n println("Active")\n} else {\n println("Not active")\n}\n```\n\nBut the compiler gives an error: "Type mismatch: inferred type is Boolean? but Boolean was expected".\n\nI understand that `Boolean?` is a nullable type, and `if` expects a regular `Boolean`. But how do I properly handle this situation? I need the program to do something when it's `null` as well (for example, consider it as "not active").\n\nTell me how this is done in Kotlin? I tried using `if (isActive == true)`, but...