Handle invalid version numbers

This commit is contained in:
Myles 2016-03-06 10:49:21 +00:00
parent 4124c3454e
commit 2a247595c8

View File

@ -77,8 +77,12 @@ public class UpdateUtil {
return null;
}
}
Version current = new Version(ViaVersion.getInstance().getVersion());
Version current;
try {
current = new Version(ViaVersion.getInstance().getVersion());
} catch (IllegalArgumentException e) {
return "You are using a debug/custom version, consider updating.";
}
Version newest = new Version(newestString);
if (current.compareTo(newest) < 0)
return "There is a newer version available: " + newest.toString();