Avoid NPE
Merge pull request #5 from janodvarko/exception

Avoid NPE