public static Collection<Terminal> getTerminals(IElement e, Collection<Terminal> result, boolean clearResult) {
if (clearResult)
result.clear();
- 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);
+ }
return result;
}