Simplify null pointer handling