[FIX] Фикс NPE при установки через скрипт

This commit is contained in:
Gravit 2019-04-27 17:22:45 +07:00
parent 701878bcf4
commit 2fcfaef058
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -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");