Skip to content

Commit b57b9b5

Browse files
authored
Merge pull request #6429 from IllianiCBT/scenarioResolutionIllegalArgumentExceptionTrigger
Scenario resolution illegal argument exception trigger
2 parents 8901b32 + b5ff610 commit b57b9b5

File tree

1 file changed

+26
-12
lines changed

1 file changed

+26
-12
lines changed

Diff for: MekHQ/src/mekhq/MekHQ.java

+26-12
Original file line numberDiff line numberDiff line change
@@ -785,36 +785,50 @@ public void autoResolveConcluded(AutoResolveConcludedEvent autoResolveConcludedE
785785
true,
786786
tracker);
787787
resolveDialog.setVisible(true);
788-
// TODO remove these safeties as they're shown to be unnecessary
788+
// TODO remove these safeties once the investigation is concluded -Illiani
789789
if (resolveDialog == null) {
790-
throw new IllegalStateException("resolveDialog is null");
790+
logger.errorDialog(new IllegalStateException(),
791+
"resolveDialog is null please report this as a bug",
792+
"UNDER ACTIVE INVESTIGATION");
791793
}
792794
if (resolveDialog.wasAborted()) {
793-
// TODO remove these safeties as they're shown to be unnecessary
795+
// TODO remove these safeties once the investigation is concluded -Illiani
794796
Map<UUID, ?> peopleStatus = tracker.getPeopleStatus();
795797
if (peopleStatus == null) {
796-
throw new IllegalStateException("People status map in tracker is null");
798+
logger.errorDialog(new IllegalStateException(),
799+
"People status map in tracker is null please report this as a bug",
800+
"UNDER ACTIVE INVESTIGATION");
797801
}
798802

799803
for (UUID personId : tracker.getPeopleStatus().keySet()) {
800-
// TODO remove these safeties as they're shown to be unnecessary
804+
// TODO remove these safeties once the investigation is concluded -Illiani
801805
if (getCampaign() == null) {
802-
throw new IllegalStateException("Campaign instance is null");
806+
logger.errorDialog(new IllegalStateException(),
807+
"Campaign instance is null please report this as a bug",
808+
"UNDER ACTIVE INVESTIGATION");
803809
}
804810

805811
Person person = getCampaign().getPerson(personId);
806812

807813
if (person == null) {
808-
throw new IllegalArgumentException("Person with ID " +
809-
personId +
810-
" does not exist in the campaign");
814+
// TODO remove these safeties once the investigation is concluded -Illiani
815+
logger.errorDialog(new IllegalStateException(),
816+
"Person with ID " +
817+
personId +
818+
" does not exist in the campaign" +
819+
" please report this" +
820+
" as a bug",
821+
"UNDER ACTIVE INVESTIGATION");
811822
}
812823

813824
Integer priorHits = person.getHitsPrior();
814-
// TODO remove these safeties as they're shown to be unnecessary
825+
// TODO remove these safeties once the investigation is concluded -Illiani
815826
if (priorHits == null) {
816-
throw new IllegalStateException("Person's prior hits are not set for person " +
817-
person.getFullName());
827+
logger.errorDialog(new IllegalStateException(),
828+
"Person's prior hits are not set for person " +
829+
person.getFullName() +
830+
" please report this as a bug",
831+
"UNDER ACTIVE INVESTIGATION");
818832
}
819833
person.setHits(priorHits);
820834
}

0 commit comments

Comments
 (0)