Adding missing null check
Merge pull request #1196 from andrerod/dev

Adding missing null check