From 7ef23780cd3d0d19c506831f89be75935980f0cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Mon, 20 Jan 2014 03:15:56 +0100 Subject: [PATCH] Remote: handle the case of a missing url --- src/remote.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/remote.c b/src/remote.c index b5d7059..a1a5eac 100644 --- a/src/remote.c +++ b/src/remote.c @@ -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); }