Made GUIComponent.getPin(String) fail-fast
authorDaniel Kirschten <daniel.kirschten@gmx.de>
Fri, 21 Jun 2019 14:00:48 +0000 (16:00 +0200)
committerDaniel Kirschten <daniel.kirschten@gmx.de>
Fri, 21 Jun 2019 14:00:48 +0000 (16:00 +0200)
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIComponent.java

index c19b800..22f1fbf 100644 (file)
@@ -89,7 +89,10 @@ public abstract class GUIComponent
 
        public Pin getPin(String name)
        {
-               return pinsByName.get(name);
+               Pin pin = pinsByName.get(name);
+               if (pin == null)
+                       throw new IllegalArgumentException("No pin with the name " + name);
+               return pin;
        }
 
        // @formatter:off