mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 11:39:11 +03:00
Проверки на null для "защиты от дурака"
This commit is contained in:
parent
1b12dd895a
commit
45666e6090
1 changed files with 2 additions and 0 deletions
|
@ -106,6 +106,7 @@ public static void main(String[] args) throws Throwable {
|
||||||
}
|
}
|
||||||
Class<?> mainClass;
|
Class<?> mainClass;
|
||||||
if (config.customClassPath) {
|
if (config.customClassPath) {
|
||||||
|
if(config.classpath == null) throw new UnsupportedOperationException("classpath is null, customClassPath not available");
|
||||||
String[] cp = config.classpath.split(":");
|
String[] cp = config.classpath.split(":");
|
||||||
if (!ServerAgent.isAgentStarted()) {
|
if (!ServerAgent.isAgentStarted()) {
|
||||||
LogHelper.warning("JavaAgent not found. Using URLClassLoader");
|
LogHelper.warning("JavaAgent not found. Using URLClassLoader");
|
||||||
|
@ -123,6 +124,7 @@ public static void main(String[] args) throws Throwable {
|
||||||
if (!ServerAgent.isAgentStarted()) {
|
if (!ServerAgent.isAgentStarted()) {
|
||||||
throw new UnsupportedOperationException("JavaAgent not found, autoloadLibraries not available");
|
throw new UnsupportedOperationException("JavaAgent not found, autoloadLibraries not available");
|
||||||
}
|
}
|
||||||
|
if(config.librariesDir == null) throw new UnsupportedOperationException("librariesDir is null, autoloadLibraries not available");
|
||||||
Path librariesDir = Paths.get(config.librariesDir);
|
Path librariesDir = Paths.get(config.librariesDir);
|
||||||
LogHelper.info("Load libraries");
|
LogHelper.info("Load libraries");
|
||||||
ServerAgent.loadLibraries(librariesDir);
|
ServerAgent.loadLibraries(librariesDir);
|
||||||
|
|
Loading…
Reference in a new issue