Fixed a potential NPE

It is preferable to have a nop output rather than NPE.

Fixes #107
Thx!
Merge pull request #108 from delahee/patch-1

Fixed a potential NPE