You can remove this `if` and use NullObjectPattern