Skip to content

Commit

Permalink
Do not allow negative qty_multiplier
Browse files Browse the repository at this point in the history
Co-authored-by: kvid <[email protected]>
  • Loading branch information
formatc1702 and kvid authored Apr 16, 2024
1 parent 6d6eed3 commit 762ea09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wireviz/DataClasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def get_qty_multiplier(self, qty_multiplier: Optional[ConnectorMultiplier]) -> i
elif qty_multiplier == "populated":
return sum(self.visible_pins.values())
elif qty_multiplier == 'unpopulated':
return (self.pincount - sum(self.visible_pins.values()))
return max(0, self.pincount - sum(self.visible_pins.values()))
else:
raise ValueError(
f"invalid qty multiplier parameter for connector {qty_multiplier}"
Expand Down

0 comments on commit 762ea09

Please sign in to comment.