From 9dede10c7e66d3ccdecdc8369bbc6057ec8fbdca Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 21 2015 13:59:43 +0000 Subject: Handle the situation where the specified branch could not be found --- diff --git a/pagure/ui/fork.py b/pagure/ui/fork.py index 64a082a..901ddb3 100644 --- a/pagure/ui/fork.py +++ b/pagure/ui/fork.py @@ -256,7 +256,9 @@ def request_pull_patch(repo, requestid, username=None): orig_repo = pygit2.Repository(parentpath) branch = repo_obj.lookup_branch(request.branch_from) - commitid = branch.get_object().hex + commitid = None + if branch: + commitid = branch.get_object().hex diff_commits = [] if not repo_obj.is_empty and not orig_repo.is_empty: