adds null check
Merge pull request #231 from way2muchnoise/nei-updates

adds null check