Skip to content

Commit

Permalink
Merge pull request #23 from zhangyiant/zhangyiant/no-arrays
Browse files Browse the repository at this point in the history
Handle the case where there's no array field in block template dictio…
  • Loading branch information
zhangyiant authored Mar 26, 2022
2 parents f4c9c16 + c38f021 commit a30dfed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions register_printer/data_model/block_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ def generate_block_template(block_template_dict):
)
register.add_field(field)
block_template.add_register(register)
for array_dict in block_template_dict["arrays"]:
array = ArrayTemplate.from_dict(array_dict)
block_template.add_array(array)
if "arrays" in block_template_dict:
for array_dict in block_template_dict["arrays"]:
array = ArrayTemplate.from_dict(array_dict)
block_template.add_array(array)
return block_template


Expand Down

0 comments on commit a30dfed

Please sign in to comment.