Simplify not-null-or-undefined check
Merge pull request #988 from joliss/null-checks

Simplify not-null-or-undefined check