Skip to content

Commit

Permalink
Fixed error caused by indexing with 'manf#' on components with no suc…
Browse files Browse the repository at this point in the history
…h field.
  • Loading branch information
Dave Vandenbout committed Jan 10, 2016
1 parent 39109cc commit e368440
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kicost/kicost.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,9 @@ def extract_fields(part):
sub_group.manf_nums = [manf_num]
sub_group.refs = []
for ref in grp.refs:
if components[ref]['manf#'] == manf_num:
# Use get() which returns None if the component has no manf# field.
# That will match if the group manf_num is also None.
if components[ref].get('manf#') == manf_num:
sub_group.refs.append(ref)
new_component_groups.append(sub_group)

Expand Down

0 comments on commit e368440

Please sign in to comment.