Catch nil error instances

Unfortunately libgit2 sometimes returns an error without setting an
error message. Provide an alternative message instead of trying to
dereference nil.
Merge pull request #25 from carlosmn/error-nil

Catch nil error instances