Skip to content

Instantly share code, notes, and snippets.

@amatkivskiy
Last active May 15, 2020 04:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amatkivskiy/4d015338cf450e4c441b459afa5e8385 to your computer and use it in GitHub Desktop.
Save amatkivskiy/4d015338cf450e4c441b459afa5e8385 to your computer and use it in GitHub Desktop.
val child = parentObj.child?.child?.child
if (child != null) {
doSomethingOnBooleanValue(child.isValid)
} else {
// handle null value here
}
fun doSomethingOnBooleanValue(valid: Boolean) {
if (valid) {
// `valid` is really true
} else {
// `valid` is false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment