From 2159ee3817f0200146f254fdd68b0ee5c97e75ce Mon Sep 17 00:00:00 2001 From: upagge Date: Wed, 6 May 2020 13:09:05 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B1=D0=B0=D0=B3=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- src/main/java/org/sadtech/autoresponder/AutoResponder.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e35a9a9..908c80d 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.sadtech.autoresponder autoresponder - 1.9.3-RELEASE + 1.9.4-SNAPSHOT jar Abstract Autoresponder diff --git a/src/main/java/org/sadtech/autoresponder/AutoResponder.java b/src/main/java/org/sadtech/autoresponder/AutoResponder.java index 1f2c15c..8fd61b2 100644 --- a/src/main/java/org/sadtech/autoresponder/AutoResponder.java +++ b/src/main/java/org/sadtech/autoresponder/AutoResponder.java @@ -53,7 +53,12 @@ public class AutoResponder { public Optional answer(@NonNull Long entityId, @NonNull String message) { Optional> unitPointer = unitPointerService.getByEntityId(entityId); final Optional answer = nextUnit( - unitPointer.isPresent() ? unitPointer.get().getUnit().getNextUnits() : startUnits, message + unitPointer.isPresent() + && unitPointer.get().getUnit().getNextUnits() != null + && !unitPointer.get().getUnit().getNextUnits().isEmpty() + ? unitPointer.get().getUnit().getNextUnits() + : startUnits, + message ); if (answer.isPresent()) { final U unitAnswer = answer.get();