Skip to content

Commit 5472ce0

Browse files
committed
Summary:
- Invalid academies are now skipped entirely rather than being added to the map - Logs a warning with academy name, set name, and filename for debugging
1 parent d6e106e commit 5472ce0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

MekHQ/src/mekhq/campaign/personnel/education/AcademyFactory.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,12 @@ public void loadAcademyFromStream(InputStream inputStream, String fileName) {
140140
academy.setId(id);
141141
id++;
142142
academy.setSet(currentSetName);
143-
// Validate that parallel lists have matching sizes
144-
academy.validateListSizes();
143+
// Validate that parallel lists have matching sizes, skip invalid academies
144+
if (!academy.validateListSizes()) {
145+
LOGGER.warn("Skipping academy '{}' in set '{}' from file '{}' due to invalid list sizes.",
146+
academy.getName(), currentSetName, fileName);
147+
continue;
148+
}
145149
tempAcademyMap.put(academy.getName(), academy);
146150
}
147151
academyMap.put(currentSetName, tempAcademyMap);

0 commit comments

Comments
 (0)