Join Slack
Powered by
Hi guys, silly question... If I'm using `something...
# android
j
jackmiras
11/16/2017, 5:14 PM
Hi guys, silly question... If I'm using
something?.let{}
there is a fallback delegate for the case of the item be null? Or in this case I should write a null check?
l
louiscad
11/16/2017, 8:53 PM
Not for let, because the last statement of let may be null, but there's for also. You can simply use elvis operator like this:
something?.also { ... } ?: somethingElse()
☝🏼 2
Open in Slack
Previous
Next