avoid nullpointers
Merge pull request #14 from lformella/master