diff --git a/pom.xml b/pom.xml index 66bc948..e35a9a9 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.sadtech.autoresponder autoresponder - 1.10-SNAPSHOT + 1.9.3-RELEASE jar Abstract Autoresponder diff --git a/src/main/java/org/sadtech/autoresponder/AutoResponder.java b/src/main/java/org/sadtech/autoresponder/AutoResponder.java index e309b74..1f2c15c 100644 --- a/src/main/java/org/sadtech/autoresponder/AutoResponder.java +++ b/src/main/java/org/sadtech/autoresponder/AutoResponder.java @@ -62,8 +62,10 @@ public class AutoResponder { } else { unitPointerService.save(new UnitPointer<>(entityId, unitAnswer)); } + return answer; + } else { + return Optional.ofNullable(defaultUnit); } - return answer; } /** @@ -103,8 +105,7 @@ public class AutoResponder { } } } - final Optional max = searchUnit.stream().max(UNIT_PRIORITY_COMPARATOR); - return max.isPresent() ? max : Optional.ofNullable(defaultUnit); + return searchUnit.stream().max(UNIT_PRIORITY_COMPARATOR); } private boolean patternReg(@NonNull U unit, String message) {