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();