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 <kvid@users.noreply.github.com>
  • Loading branch information
formatc1702 and kvid committed Apr 16, 2024
1 parent 848fdf0 commit f98bf2a
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 f98bf2a

Please sign in to comment.