Skip to content

Commit

Permalink
Wrap inventreeBranch check in try/except (#5842)
Browse files Browse the repository at this point in the history
- Same as in master branch
  • Loading branch information
SchrodingersGat committed Nov 3, 2023
1 parent d2a313b commit 5d55555
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions InvenTree/InvenTree/version.py
Expand Up @@ -162,8 +162,11 @@ def inventreeBranch():
if main_commit is None:
return None

branch = main_repo.refs.follow(b'HEAD')[0][1].decode()
return branch.removeprefix('refs/heads/')
try:
branch = main_repo.refs.follow(b'HEAD')[0][1].decode()
return branch.removeprefix('refs/heads/')
except IndexError:
return None # pragma: no cover


def inventreeTarget():
Expand Down

0 comments on commit 5d55555

Please sign in to comment.