mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FIX] Фикс NPE при установки через скрипт
This commit is contained in:
parent
701878bcf4
commit
2fcfaef058
1 changed files with 11 additions and 1 deletions
|
@ -738,11 +738,21 @@ private void generateConfigIfNotExists(boolean testEnv) throws IOException {
|
||||||
newConfig.setLegacyAddress("localhost");
|
newConfig.setLegacyAddress("localhost");
|
||||||
newConfig.setProjectName("test");
|
newConfig.setProjectName("test");
|
||||||
} else {
|
} else {
|
||||||
System.out.println("LaunchServer address: ");
|
System.out.println("LaunchServer legacy address(default: localhost): ");
|
||||||
newConfig.setLegacyAddress(commandHandler.readLine());
|
newConfig.setLegacyAddress(commandHandler.readLine());
|
||||||
System.out.println("LaunchServer projectName: ");
|
System.out.println("LaunchServer projectName: ");
|
||||||
newConfig.setProjectName(commandHandler.readLine());
|
newConfig.setProjectName(commandHandler.readLine());
|
||||||
}
|
}
|
||||||
|
if(newConfig.legacyAddress == null)
|
||||||
|
{
|
||||||
|
LogHelper.error("Legacy address null. Using localhost");
|
||||||
|
newConfig.legacyAddress = "localhost";
|
||||||
|
}
|
||||||
|
if(newConfig.projectName == null)
|
||||||
|
{
|
||||||
|
LogHelper.error("ProjectName null. Using MineCraft");
|
||||||
|
newConfig.projectName = "MineCraft";
|
||||||
|
}
|
||||||
|
|
||||||
// Write LaunchServer config
|
// Write LaunchServer config
|
||||||
LogHelper.info("Writing LaunchServer config file");
|
LogHelper.info("Writing LaunchServer config file");
|
||||||
|
|
Loading…
Reference in a new issue