Code should not do half of the work and then dereference the null and crash only then leaving half of some work done causing the system to be in an invalid state.