First when: Just do a check for null with a elvis ...
# arrow
l
First when: Just do a check for null with a elvis operator or, if use are using Option, use a fold
h
could you provide example pls
l
Sure, but could you say the Type of info?
Something like this:
Copy code
info?.run {
//your else code here!
} ?: unauthorized()
or
Copy code
info.fold({
    unauthorized()
},{
    //your else code here!
})
h
The type of 'info' is I think use too many
Either<Errors.ApplicationError, ValidInfo>
ohhh my bad. info is just a ' String?'