[FIX] May be NPE

This commit is contained in:
Gravit'a 2021-08-07 11:59:36 +07:00
parent 5ba36c3a1c
commit 7e77862cd4

View file

@ -103,6 +103,9 @@ public synchronized static List<JavaVersion> findJava() {
} }
private static JavaVersion tryFindJavaByPath(Path path) { private static JavaVersion tryFindJavaByPath(Path path) {
if(javaVersionsCache == null) {
return null;
}
for(JavaVersion version : javaVersionsCache) { for(JavaVersion version : javaVersionsCache) {
if(version.jvmDir.equals(path)) { if(version.jvmDir.equals(path)) {
return version; return version;