mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2024-11-21 03:10:58 +08:00
Avoid throwing NPE when the Java version cannot be obtained
This commit is contained in:
parent
651aedaa50
commit
8b224cb240
@ -54,8 +54,14 @@ public final class JavaVersion {
|
|||||||
this.binary = binary;
|
this.binary = binary;
|
||||||
this.longVersion = longVersion;
|
this.longVersion = longVersion;
|
||||||
this.platform = platform;
|
this.platform = platform;
|
||||||
|
|
||||||
|
if (longVersion != null) {
|
||||||
version = parseVersion(longVersion);
|
version = parseVersion(longVersion);
|
||||||
versionNumber = VersionNumber.asVersion(longVersion);
|
versionNumber = VersionNumber.asVersion(longVersion);
|
||||||
|
} else {
|
||||||
|
version = UNKNOWN;
|
||||||
|
versionNumber = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Path getBinary() {
|
public Path getBinary() {
|
||||||
|
Loading…
Reference in New Issue
Block a user