From 7e77862cd459c3a44dd1fb2591548c1558875663 Mon Sep 17 00:00:00 2001 From: Gravit'a Date: Sat, 7 Aug 2021 11:59:36 +0700 Subject: [PATCH] [FIX] May be NPE --- .../src/main/java/pro/gravit/utils/helper/JavaHelper.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java index f901da42..286806bd 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/JavaHelper.java @@ -103,6 +103,9 @@ public synchronized static List findJava() { } private static JavaVersion tryFindJavaByPath(Path path) { + if(javaVersionsCache == null) { + return null; + } for(JavaVersion version : javaVersionsCache) { if(version.jvmDir.equals(path)) { return version;