From c89a0513ff274e058c86748df22ada11d1c01340 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Wed, 19 Apr 2023 22:24:06 +0200 Subject: [PATCH] Fix Leaderboard IndexOutOfBoundsException --- src/de/steamwar/lobby/util/Leaderboard.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/de/steamwar/lobby/util/Leaderboard.java b/src/de/steamwar/lobby/util/Leaderboard.java index 49a153c..0b7e5cc 100644 --- a/src/de/steamwar/lobby/util/Leaderboard.java +++ b/src/de/steamwar/lobby/util/Leaderboard.java @@ -37,6 +37,7 @@ public class Leaderboard { entities.forEach(REntity::die); entities.clear(); List leaderboard = getLeaderboard(); + if (leaderboard.isEmpty()) return; long bestTime = leaderboard.get(0).time; for (int i = 0; i <= best; i++) { if (best - i >= leaderboard.size()) continue;