Closed Matthewacon closed 5 years ago
Somewhere in my gradle cache there is a snapshot version of MC and because there isn't a designated game version, seeing that it is a snapshot, the version string was automatically cut to "unknown", by line 66. The code to automatically return true
or false
based on whether v1
or v2
is equal to "unknown"
was already there, however it was above the subString(int, int)
invocation. The only modification that I made was moving the subString(int, int)
calls above the if blocks at line 60
I don't see how this helps. Now it will crash on "unknown" as it will try to substring from 0 to -1.
When I said that the version for the release was "unknown", I meant it still follows the convention for versioning releases: MCVER-FORGEVER
, however the substring created for the MC version won't be a series of period delimited numbers because the MCVER
portion of the string is actually "unknown" and not, for example, "1.7.10-FORGEVER". Moving the substring reassignment of v1
and v2
above the if
blocks that check for an "unknown" version string, solves the otherwise unhandled NumberFormatException
thrown when trying to parse "unknown" as a number.
I know it's been a long time, but I still don't see how this fixes the problem, unless the version string is literally "unknown-somethingelse" which I don't think is possible.
I've switched systems since posting this PR and I haven't experienced this error since. I don't remember in what context this error occurred or what the steps are to reproduce it, so I'm closing the PR.
When can this happen?