From 12a525f581a6b9b23cd1e27b450157c943e2fcc8 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 1 Aug 2024 08:50:29 +0200 Subject: [PATCH] GameReports: remove error message and deal with missing rounds --- megamek/src/megamek/common/GameReports.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/megamek/src/megamek/common/GameReports.java b/megamek/src/megamek/common/GameReports.java index 8b5b2e39de7..37db07005d1 100644 --- a/megamek/src/megamek/common/GameReports.java +++ b/megamek/src/megamek/common/GameReports.java @@ -54,17 +54,13 @@ public boolean hasReportsforRound(int round) { @Override public List get(int round) { - if (round == 0) { - // Round 0 (deployment) reports are lumped in with round one. - round = 1; - } + // Rounds prior to 1 (initial deployment) are lumped in with round 1 + round = Math.max(1, round); if (hasReportsforRound(round)) { return reports.get(round - 1); + } else { + return new ArrayList<>(); } - - LogManager.getLogger().error("GameReports.get() was asked for reports of round {} which it does not have", - round, new RuntimeException()); - return null; } /**