Skip to content

Commit

Permalink
Avoid UnboundLocalError when exception is raised
Browse files Browse the repository at this point in the history
in this case 'tpl' is not assigned
  • Loading branch information
mcweidner authored and bosd committed Apr 25, 2023
1 parent 61f2cb2 commit 25ea04c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/invoice2data/extract/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def read_templates(folder=None):
tpl = json.loads(template_file.read())
except ValueError as error:
logger.warning("json Loader Failed to load %s template:\n%s", name, error)
continue
tpl["template_name"] = name

# Test if all required fields are in template
Expand Down

0 comments on commit 25ea04c

Please sign in to comment.