Help me understand what is meant by "Case 2 doesn’...
# getting-started
t
Help me understand what is meant by "Case 2 doesn’t work with mutating properties, instead in case 1 the variable 
it
 is always not null." The text in quotation was in response to: What is actually the difference and what is the preferred to use: Case 1:
variable?.let { //... }
Case 2:
if (variable != null) { //... }
e
if it's non-local or captured, another thread could be mutating the var
if it has custom getter or delegation then it could change at any time regardless
t
Thank you! Is there a code snippet so that I could practically run and see Kotlin throwing NPE when another thread interferes or delegation as you mentioned.
n
I mean, if
variable
is a field, you can imagine another thread calling
setVariable
e
easy to imagine
t
Thank you so much for great examples! This makes things very clear!