fixes build and readded null check
Merge pull request #400 from way2muchnoise/1.7-update

fixes build and readded null check