Last active
May 15, 2020 04:38
-
-
Save amatkivskiy/4d015338cf450e4c441b459afa5e8385 to your computer and use it in GitHub Desktop.
For medium article: https://medium.com/@amatkivskiy/legacy-code-pitfalls-35feda5acb71
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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