add null check
Merge pull request #854 from dennishendriksen/master

Big fux: add null check