From 33ca8122f975dd367d4615d449bc904f5d48b472 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 23 Sep 2020 09:27:11 -0400 Subject: [PATCH] Render empty repo if there's no default branch --- gitsrht/blueprints/repo.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gitsrht/blueprints/repo.py b/gitsrht/blueprints/repo.py index c1c5013..c4773b8 100644 --- a/gitsrht/blueprints/repo.py +++ b/gitsrht/blueprints/repo.py @@ -87,6 +87,9 @@ def summary(owner, repo): return render_empty_repo(owner, repo) default_branch = git_repo.default_branch() + if not default_branch: + return render_empty_repo(owner, repo) + tip = git_repo.get(default_branch.target) commits = get_last_3_commits(git_repo, tip) link_prefix = url_for( -- 2.38.4