fix a flipped null check
Merge pull request #2173 from birarda/null-checks

fix a flipped NULL pointer check