Remote: handle the case of a missing url

This commit is contained in:
Carlos Martín Nieto 2014-01-20 03:15:56 +01:00
parent 73518fd804
commit 7ef23780cd

@ -248,7 +248,13 @@ PyDoc_STRVAR(Remote_url__doc__, "Url of the remote");
PyObject *
Remote_url__get__(Remote *self)
{
return to_unicode(git_remote_url(self->remote), NULL, NULL);
const char *url;
url = git_remote_url(self->remote);
if (!url)
Py_RETURN_NONE;
return to_unicode(url, NULL, NULL);
}