Adding a null check.