Remote: handle the case of a missing url
This commit is contained in:
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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user