Jul 20, 2017 · 1 min read
Your example for “let” function is not correct!
person?.let { person.setName("Tony Stark")}
You need use to “it”:
person?.let { it.setName("Tony Stark")}
Because person will be null if other thread cleared it
Your example for “let” function is not correct!
person?.let { person.setName("Tony Stark")}
You need use to “it”:
person?.let { it.setName("Tony Stark")}
Because person will be null if other thread cleared it