In my Kotlin app I have nullable variable like this
private var myCallback : (() -> Unit)? = null
Is it possible to use null safety operator ?
to call it? This gives me a compilation error.
myCallback?()
I found only this ugly way for a call if it is not null
if(myCallback != null)
myCallback!!()