bug fix

* missing nullptr check