修改方向杆数据构建bug

This commit is contained in:
joylink_zhangsai 2022-12-14 18:22:42 +08:00
parent 374390696d
commit 67459ddad8

View File

@ -205,7 +205,7 @@ public class MapDeviceBuilder {
relSectionList.add(section); relSectionList.add(section);
while (true) { while (true) {
section = section.getSectionOf(right); section = section.getSectionOf(right);
if (section.isSwitchTrack()) { if (section == null || section.isSwitchTrack()) {
break; break;
} else if (section.isStandTrack() && section.getStation().equals(endStation)) { } else if (section.isStandTrack() && section.getStation().equals(endStation)) {
directionRod.getStandTrackList().add(section); directionRod.getStandTrackList().add(section);
@ -217,7 +217,7 @@ public class MapDeviceBuilder {
} }
relSectionList.add(section); relSectionList.add(section);
} }
if (!section.isSwitchTrack()) { if (section != null && !section.isSwitchTrack()) {
sectionSet.add(section); sectionSet.add(section);
} }
} }