From b3d860dfd06e8c3ab2e2fa8ef3a797c1490179e4 Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Mon, 7 Oct 2024 09:07:19 +0200 Subject: [PATCH] fix #15547 --- src/netbuild/NBOwnTLDef.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/netbuild/NBOwnTLDef.cpp b/src/netbuild/NBOwnTLDef.cpp index fdbc8bad4e02..7101a6c9bd2e 100644 --- a/src/netbuild/NBOwnTLDef.cpp +++ b/src/netbuild/NBOwnTLDef.cpp @@ -1017,6 +1017,10 @@ NBOwnTLDef::patchNEMAStateForCrossings(const std::string& state, //std::cout << " patchNEMAStateForCrossings green=" << greenEdge->getID() << " other=" << Named::getIDSecure(otherChosen) << " end=" << Named::getIDSecure(end) << " all=" << toString(all) << "\n"; EdgeVector::const_iterator end = std::find(all.begin(), all.end(), endEdge); + if (end == all.end()) { + // at least prevent an infinite loop + end = start; + } auto it = start; NBContHelper::nextCCW(all, it); for (; it != end; NBContHelper::nextCCW(all, it)) {