I was trying to solve the null safety question on kotlin koans (Kotlin Playground: Edit, Run, Share Kotlin Code Online). I wrote the following code fun
sendMessageToClient(
client: Client?, message: String?, mailer: Mailer
) {
message?.let{
m-> {
client?.let{ c ->
if(c.personalInfo != null && c.personalInfo.email != null ){
mailer.sendMessage(c.personalInfo.email,m)
}
}
}
}
}
And I get the following error
Fail: everythingIsOk: The function ‘sendMessage’ should be invoked expected: but was:
Passed: noClient
Passed: noMessage
Passed: noPersonalInfo
Passed: noEmail What does it mean ?