Created
July 30, 2016 10:47
-
-
Save LukaJCB/3c904567ee9b16d95caf5679bddcf2cf to your computer and use it in GitHub Desktop.
This file contains 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
String constructionFirm = person.getResidence().getAddress().getConstructionFirm(); | |
//Can't do this because residence, address or constructionFirm could be null. | |
String constructionFirm = null; | |
if(person != null){ | |
Residence residence = person.getResidence(); | |
if(residence != null){ | |
Address address = residence.getAddress(); | |
if(address != null){ | |
constructionFirm = adress.getConstructionFirm(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment