From d336f19600ebbaad3d27c4b7076bf8750adfde55 Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 3 Aug 2024 11:08:15 +0200 Subject: [PATCH] null guard for turns --- megamek/src/megamek/common/Game.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/megamek/src/megamek/common/Game.java b/megamek/src/megamek/common/Game.java index ec7dd3a6d8e..7a089326b21 100644 --- a/megamek/src/megamek/common/Game.java +++ b/megamek/src/megamek/common/Game.java @@ -607,7 +607,7 @@ public List getValidTargets(Entity entity) { * turns to play */ public @Nullable GameTurn getTurnForPlayer(int pn) { - synchronized (turnVector) { + if ((turnIndex >= 0) && (turnIndex < turnVector.size())) { for (int i = turnIndex; i < turnVector.size(); i++) { GameTurn gt = turnVector.get(i); if (gt.isValid(pn, this)) {