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 committed Apr 16, 2024
1 parent 42c89ca commit 24e02f5
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 24e02f5

Please sign in to comment.