Merge pull request #5826 from IThundxr/mc1.18/fixSignalNPE

fix: Signal Group NPE
This commit is contained in:
Max Mielke 2024-03-16 17:20:44 +01:00 committed by GitHub
commit bb7e835a8d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -107,6 +107,8 @@ public class EdgeData {
if (!hasSignalBoundaries())
return getEffectiveEdgeGroupId(graph);
SignalBoundary firstSignal = next(EdgePointType.SIGNAL, 0);
if (firstSignal == null)
return null;
UUID currentGroup = firstSignal.getGroup(edge.node1);
for (TrackEdgePoint trackEdgePoint : getPoints()) {

View file

@ -505,7 +505,7 @@ public class TrackGraph {
SignalEdgeGroup group = Create.RAILWAYS.signalEdgeGroups.get(groupId);
SignalEdgeGroup otherGroup = Create.RAILWAYS.signalEdgeGroups.get(otherGroupId);
if (group == null || otherGroup == null)
if (group == null || otherGroup == null || groupId == null || otherGroupId == null)
continue;
intersection.groupId = groupId;