Skip to content

Commit

Permalink
Handle properly when there ano default components
Browse files Browse the repository at this point in the history
  • Loading branch information
yaqwsx committed Sep 22, 2022
1 parent 9440afa commit 3e38b13
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pcbdraw/populate.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def populate(input: str, output: str, board: Optional[str], imgname: Optional[st
sys.exit(f"Missing parameter {e} either in template file or source header")

if type == "html":
renderer = Renderer(mistune.renderers.HTMLRenderer, header.get("initial_components")) # type: ignore
renderer = Renderer(mistune.renderers.HTMLRenderer, header.get("initial_components", [])) # type: ignore
outputfile = "index.html"
try:
assert template is not None
Expand All @@ -292,7 +292,7 @@ def populate(input: str, output: str, board: Optional[str], imgname: Optional[st
except IOError:
sys.exit("Cannot open template file " + str(template))
else:
renderer = Renderer(pcbdraw.mdrenderer.MdRenderer, header.get("initial_components")) # type: ignore
renderer = Renderer(pcbdraw.mdrenderer.MdRenderer, header.get("initial_components", [])) # type: ignore
outputfile = "index.md"
parsed_content = parse_content(renderer, content)
if header is None:
Expand Down

0 comments on commit 3e38b13

Please sign in to comment.