Created
August 27, 2015 04:22
-
-
Save dfmartin/cd2ce4ed763b09f8f1f0 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
var x = People[0].Address.City; | |
// oops! Null reference exception. Need to replace with. . . | |
string x = string.Empty; | |
if(People != null) { | |
var p = People[0]; | |
if (p != null) { | |
var a = p.Address; | |
if (a != null) { | |
x = a.City; | |
} | |
} | |
} | |
// whew! Did all my braces line up? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment