fix NPE
This commit is contained in:
@@ -91,10 +91,16 @@ public class Windows extends OS {
|
||||
}
|
||||
catch (NullPointerException e) {
|
||||
System.err.println("Windows::isSupported Failed to extract Windows build number: " + e);
|
||||
String ver = operatingSystem.getVersionInfo().getVersion();
|
||||
var versionInfo = operatingSystem.getVersionInfo();
|
||||
if (versionInfo == null) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
String ver = versionInfo.getVersion();
|
||||
List<String> supportedVersions = List.of("8.1", "10", "11", "Server 2016", "Server 2012 R2", "Server 2019", "Server 2022");
|
||||
return super.isSupported() && supportedVersions.contains(ver);
|
||||
}
|
||||
}
|
||||
return
|
||||
super.isSupported() &&
|
||||
buildNumber >= MINIMUM_SUPPORTED_BUILD &&
|
||||
|
||||
Reference in New Issue
Block a user