If you split out the ternary operator to an `if el...
# announcements
f
If you split out the ternary operator to an
if else
it becomes:
Copy code
val result = if (selector != null) {
    selector.onClick()
} else {
    null
}
if (result == null) {
    throw Kotlin.newThrowable();
}
A more elegant form if you are more comfortable reading it:
Copy code
val result = if (selector != null) selector.onClick() else null

if (result == null) {
    throw Kotlin.newThrowable();
}
Personally I prefer the if else in contrast to the ternary operator. It’s a matter of taste I guess.