Let block not working, giving "Only safe (?.)…" error
My parent variable is nullable, and haves a getWidth function. I wanna call getWidth only if parent is not null, so i did this let function. return parent.let { it.getWidth() * (perWidth / 100.0f) } ?: run{ App.realWidth.toFloat() } Also, if is null, I wanna call App.realWidth.toFloat(), so I added it in a ?: run… Read More Let block not working, giving "Only safe (?.)…" error