Fixed null pointer deref during error handling
Merge pull request #13 from oliverbock/master

Fixed null pointer deref during error handling