From 2fcfaef0587df4ca802f2d0ba94310b906ca8053 Mon Sep 17 00:00:00 2001 From: Gravit <gravit.min@ya.ru> Date: Sat, 27 Apr 2019 17:22:45 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=A4=D0=B8=D0=BA=D1=81=20NPE=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=20=D1=83=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8=20=D1=87=D0=B5=D1=80=D0=B5=D0=B7=20=D1=81=D0=BA=D1=80?= =?UTF-8?q?=D0=B8=D0=BF=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/ru/gravit/launchserver/LaunchServer.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java index f71727ed..dc483640 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java @@ -738,11 +738,21 @@ private void generateConfigIfNotExists(boolean testEnv) throws IOException { newConfig.setLegacyAddress("localhost"); newConfig.setProjectName("test"); } else { - System.out.println("LaunchServer address: "); + System.out.println("LaunchServer legacy address(default: localhost): "); newConfig.setLegacyAddress(commandHandler.readLine()); System.out.println("LaunchServer projectName: "); 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 LogHelper.info("Writing LaunchServer config file");