Skip to content

Commit 0f64ac4

Browse files
committed
Fix segfault when calling repr(repo) before init
Fixes libgit2#775
1 parent 2d4c1f5 commit 0f64ac4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/repository.c

+3
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,9 @@ PyDoc_STRVAR(Repository_path__doc__,
519519
PyObject *
520520
Repository_path__get__(Repository *self, void *closure)
521521
{
522+
if (self->repo == NULL)
523+
Py_RETURN_NONE;
524+
522525
return to_path(git_repository_path(self->repo));
523526
}
524527

0 commit comments

Comments
 (0)