prevent null pointer exception
Merge pull request #320 from skelter/master

prevent null pointer exception