Adding a null check