Is there a way in kotlin to prevent function call if all (or some) arguments are null? For example Having function:
fun test(a: Int, b: Int) { /* function bo
NO! is the answer to your question(as far as I know)
Your best bet(assuming the function is not exposed) is what you said.
a?.let { b?.let { test(a, b) } }
If the function is exposed, and might be called without these checks, then you need to put the checks inside your function.
fun test(a: Int?, b: Int?) {
if (listOf(a, b).filterNotNull().size < 2) return
println("Function was called")
}