From 7dfff7e17dbb1451892a93e88acf1a225405371e Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 2 Sep 2020 10:35:12 -0400 Subject: [PATCH] log: abort(404) if git commit is not found --- gitsrht/blueprints/repo.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gitsrht/blueprints/repo.py b/gitsrht/blueprints/repo.py index 7377cc9..b5afb7d 100644 --- a/gitsrht/blueprints/repo.py +++ b/gitsrht/blueprints/repo.py @@ -403,6 +403,8 @@ def log(owner, repo, ref, path): commit = git_repo.get(from_id) except ValueError: abort(404) + if not commit: + abort(404) commits = get_log(git_repo, commit, path) -- 2.38.4