Avoid to dereference a NULL pointer.
Merge pull request #11 from genki/master

Patch to avoid a SEGV

Patch by Genki Takiuchi. Thanks!!!