Adding a missing null check
  -Rewriting boolean equation for readability