nullchecking - is this safe?
If you don't check for null it usually results in a server crash if you refer the the object that is null. So would a check like this be safe to do?
if ( talisman.Killer != null && talisman.Killer.Type != null )
Or should I nest this instead? This way is just cleaner, but I'm wondering if it will still check .killer.type even if the first one is null.
If you don't check for null it usually results in a server crash if you refer the the object that is null. So would a check like this be safe to do?
if ( talisman.Killer != null && talisman.Killer.Type != null )
Or should I nest this instead? This way is just cleaner, but I'm wondering if it will still check .killer.type even if the first one is null.