add NULL check missed in [a9b90652]

found by Jim Stichnoth

Refs #2077