From de4323812db3df1324712dfa9ad28450e314fb14 Mon Sep 17 00:00:00 2001 From: Dima Date: Sun, 28 May 2023 19:17:07 +0300 Subject: [PATCH 1/3] fix npe --- src/main/java/com/clouds42/Commands/SendMessageCommand.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/clouds42/Commands/SendMessageCommand.java b/src/main/java/com/clouds42/Commands/SendMessageCommand.java index 27706d2..698f7a9 100644 --- a/src/main/java/com/clouds42/Commands/SendMessageCommand.java +++ b/src/main/java/com/clouds42/Commands/SendMessageCommand.java @@ -74,7 +74,9 @@ public Integer call() throws Exception { logger.info("Try: {}", i); try { result = pipeIn.readLine(); - break; + if (result != null) { + break; + } } catch (IOException e) { logger.info("Can't read answer from main app..."); Thread.sleep(10); From a90237d62f3965c551d856d6d691ccde56a36ce5 Mon Sep 17 00:00:00 2001 From: Dima Date: Sun, 28 May 2023 19:22:35 +0300 Subject: [PATCH 2/3] another fix --- src/main/java/com/clouds42/Commands/SendMessageCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/clouds42/Commands/SendMessageCommand.java b/src/main/java/com/clouds42/Commands/SendMessageCommand.java index 698f7a9..91f303d 100644 --- a/src/main/java/com/clouds42/Commands/SendMessageCommand.java +++ b/src/main/java/com/clouds42/Commands/SendMessageCommand.java @@ -82,8 +82,8 @@ public Integer call() throws Exception { Thread.sleep(10); } } - if (result.equals(PipeMessages.OK_RESULT)) { - logger.info("Command success: {}", commandText); + if (result != null && result.equals(PipeMessages.OK_RESULT)) { + logger.info("Command success: {}" + commandText); client.close(); return CommandLine.ExitCode.OK; } else { From b9dffa4a2c4bea614ee6905e69e9674560263616 Mon Sep 17 00:00:00 2001 From: Dima Date: Sun, 28 May 2023 19:34:37 +0300 Subject: [PATCH 3/3] typo --- src/main/java/com/clouds42/Commands/SendMessageCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/clouds42/Commands/SendMessageCommand.java b/src/main/java/com/clouds42/Commands/SendMessageCommand.java index 91f303d..672b3a9 100644 --- a/src/main/java/com/clouds42/Commands/SendMessageCommand.java +++ b/src/main/java/com/clouds42/Commands/SendMessageCommand.java @@ -83,7 +83,7 @@ public Integer call() throws Exception { } } if (result != null && result.equals(PipeMessages.OK_RESULT)) { - logger.info("Command success: {}" + commandText); + logger.info("Command success: {}", commandText); client.close(); return CommandLine.ExitCode.OK; } else {