From 926094076c79aff674edf07f08fe2689e3521196 Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Tue, 5 Nov 2024 07:08:31 +0700 Subject: [PATCH] [FIX] Fix NPE with nativePath PR #719 --- .../src/main/java/pro/gravit/utils/launch/LegacyLaunch.java | 3 +++ .../src/main/java/pro/gravit/utils/launch/ModuleLaunch.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/LauncherCore/src/main/java/pro/gravit/utils/launch/LegacyLaunch.java b/LauncherCore/src/main/java/pro/gravit/utils/launch/LegacyLaunch.java index a7511ad9..7be6eda4 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/launch/LegacyLaunch.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/launch/LegacyLaunch.java @@ -123,6 +123,9 @@ protected Class findClass(String name) throws ClassNotFoundException { @Override public String findLibrary(String name) { + if(nativePath == null) { + return null; + } return nativePath.concat(IOHelper.PLATFORM_SEPARATOR).concat(JVMHelper.NATIVE_PREFIX).concat(name).concat(JVMHelper.NATIVE_EXTENSION); } diff --git a/LauncherCore/src/main/java/pro/gravit/utils/launch/ModuleLaunch.java b/LauncherCore/src/main/java/pro/gravit/utils/launch/ModuleLaunch.java index d83e3c44..ca1e8bb7 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/launch/ModuleLaunch.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/launch/ModuleLaunch.java @@ -262,6 +262,9 @@ protected Class findClass(String moduleName, String name) { @Override public String findLibrary(String name) { + if(nativePath == null) { + return null; + } return nativePath.concat(IOHelper.PLATFORM_SEPARATOR).concat(JVMHelper.NATIVE_PREFIX).concat(name).concat(JVMHelper.NATIVE_EXTENSION); }