given an optional variable is there any other way ...
# announcements
k
given an optional variable is there any other way to express
Copy code
if (optional != null) {
   // do a few random things with optional 
}
I’m aware you can do
optional?.someFunction
but it doesn’t also handle my needs I’m looking for something like
Copy code
if (optional.isPresent) {}
or even
Copy code
if (optional?) {}
The one thing that’s stopping me from completely enjoying Kotlin’s null-safety, is having to still type
null
in these checks.