Skip to content

Commit

Permalink
frontend: don't assume all additional repos are copr://
Browse files Browse the repository at this point in the history
The get_copr_by_repo_safe() is designed to return None.  It calls
helpers.copr_repo_fullname() which may return None as well, so when it
happens we need to return None (not try to None.split()).

Fixes: #1142
  • Loading branch information
praiskup committed Dec 6, 2019
1 parent 957a7d9 commit ce63c24
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/coprs_frontend/coprs/logic/complex_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ def get_copr_by_owner_safe(owner_name, copr_name, **kwargs):

@staticmethod
def get_copr_by_repo_safe(repo_url):
owner, copr = helpers.copr_repo_fullname(repo_url).split("/")
copr_repo = helpers.copr_repo_fullname(repo_url)
if not copr_repo:
return None
owner, copr = copr_repo.split("/")
return ComplexLogic.get_copr_by_owner_safe(owner, copr)

@staticmethod
Expand Down

0 comments on commit ce63c24

Please sign in to comment.