diff --git a/src/main/java/net/knarcraft/minecraftserverlauncher/utility/Updater.java b/src/main/java/net/knarcraft/minecraftserverlauncher/utility/Updater.java index 8a9941d..a44e104 100644 --- a/src/main/java/net/knarcraft/minecraftserverlauncher/utility/Updater.java +++ b/src/main/java/net/knarcraft/minecraftserverlauncher/utility/Updater.java @@ -87,7 +87,8 @@ public final class Updater { public static boolean isVersionHigher(String oldVersion, String newVersion) { String[] oldVersionParts = oldVersion.split("\\."); String[] newVersionParts = newVersion.split("\\."); - for (int i = 0; i < Math.max(oldVersionParts.length, newVersionParts.length); i++) { + int versionLength = Math.max(oldVersionParts.length, newVersionParts.length); + for (int i = 0; i < versionLength; i++) { int oldVersionNumber = oldVersionParts.length > i ? Integer.parseInt(oldVersionParts[i]) : 0; int newVersionNumber = newVersionParts.length > i ? Integer.parseInt(newVersionParts[i]) : 0; if (newVersionNumber != oldVersionNumber) {