исправление бага

This commit is contained in:
upagge 2020-05-06 13:09:05 +03:00
parent 807341e685
commit 2159ee3817
No known key found for this signature in database
GPG Key ID: 15CD012E46F6BA34
2 changed files with 7 additions and 2 deletions

View File

@ -6,7 +6,7 @@
<groupId>org.sadtech.autoresponder</groupId>
<artifactId>autoresponder</artifactId>
<version>1.9.3-RELEASE</version>
<version>1.9.4-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Abstract Autoresponder</name>

View File

@ -53,7 +53,12 @@ public class AutoResponder<U extends Unit> {
public Optional<U> answer(@NonNull Long entityId, @NonNull String message) {
Optional<UnitPointer<U>> unitPointer = unitPointerService.getByEntityId(entityId);
final Optional<U> 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();