- TerminalTopology tt = e.getElementClass().getSingleItem(TerminalTopology.class);
- tt.getTerminals(e, result);
+ TerminalTopology tt = e.getElementClass().getAtMostOneItemOfClass(TerminalTopology.class);
+ if (tt != null) {
+ tt.getTerminals(e, result);
+ }