Introduce Null Object

Problem:

Logic for dealing with a null field or variable is duplicated throughout your code.

Solution:

Replace the null logic with a Null Object - an object that provides the appropriate null behavior.