<@U0D06TWMA> commented on <@U4K47BTNH>’s file <htt...
# announcements
u
@Andreas Sinz commented on @dylan.graham’s file https://kotlinlang.slack.com/files/U4K47BTNH/F5F2A7GF7/-.kt: @dylan.graham i think they want you to get used to smart casts, thats why the if and nullable.
Copy code
//email is of type String?, because it can contain null
val email = client?.personalInfo?.email

if( email != null && message != null) {
//Both email and message are not null and are smartcasted to String
    mailer.sendMessage(email, message)
}