diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 680c4fc6..a7932ad1 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -17,7 +17,7 @@ ### Misc. fixes - Use `isort` and `black` for cleaner code and easier merging ([#248](https://github.com/wireviz/WireViz/pull/248)) - Code improvements ([#246](https://github.com/wireviz/WireViz/pull/246), [#250](https://github.com/wireviz/WireViz/pull/250)) -- Bug fix ([#318](https://github.com/wireviz/WireViz/pull/318)) +- Bug fixes ([#264](https://github.com/wireviz/WireViz/pull/264), [#318](https://github.com/wireviz/WireViz/pull/318)) ## [0.3.2](https://github.com/formatc1702/WireViz/tree/v0.3.2) (2021-11-27) diff --git a/src/wireviz/DataClasses.py b/src/wireviz/DataClasses.py index 523630b7..15693aa1 100644 --- a/src/wireviz/DataClasses.py +++ b/src/wireviz/DataClasses.py @@ -204,11 +204,16 @@ def __post_init__(self) -> None: self.show_pincount = self.style != "simple" for loop in self.loops: - # TODO: check that pins to connect actually exist # TODO: allow using pin labels in addition to pin numbers, just like when defining regular connections # TODO: include properties of wire used to create the loop if len(loop) != 2: raise Exception("Loops must be between exactly two pins!") + for pin in loop: + if pin not in self.pins: + raise Exception(f'Unknown loop pin "{pin}" for connector "{self.name}"!') + # Resolve https://github.com/formatc1702/WireViz/issues/263 + # Make sure loop connected pins are not hidden. + self.activate_pin(pin) for i, item in enumerate(self.additional_components): if isinstance(item, dict):