Added missing null check.