fix: Minecraft 1.20 crashing the semver parser #12
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/semver-crash-mc1.20"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Minecraft doesn't use semver, and as such, sometimes it can cause problems, like in this case:
1.20
is not a valid semver version, but we must deal with it anyway, we've made the<patch>
component optional, defaulting it to0
if missing6eeade90b0
tode85222cbf
@ -30,1 +32,3 @@
int patch = Integer.parseInt(matcher.group("patch"));
// minecraft treats the `patch` component as optional...
@Nullable String patchString = matcher.group("patch");
int patch = patchString == null ? 0 : Integer.parseInt(matcher.group("patch"));
nitpick: could use the previously assigned variable in the
Integer.parseInt
callwdym?
i'm not understanding sorry, what should i change it to?
OH, got it, forgot to actually us the var i added lol