From b23f5dc9145c3189ba91c338910cb31d984c670f Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Wed, 3 May 2023 01:22:09 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=B1=D0=B0=D0=B3=20=D0=B2=20SwitchUnitAction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../godfather/quarkus/core/action/SwitchUnitAction.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bot-core/bot-core-quarkus/src/main/java/dev/struchkov/godfather/quarkus/core/action/SwitchUnitAction.java b/bot-core/bot-core-quarkus/src/main/java/dev/struchkov/godfather/quarkus/core/action/SwitchUnitAction.java index 94d193a..817446c 100644 --- a/bot-core/bot-core-quarkus/src/main/java/dev/struchkov/godfather/quarkus/core/action/SwitchUnitAction.java +++ b/bot-core/bot-core-quarkus/src/main/java/dev/struchkov/godfather/quarkus/core/action/SwitchUnitAction.java @@ -15,14 +15,16 @@ public class SwitchUnitAction implements ActionUnit, Message @Override public Uni> action(UnitRequest, Message> unitRequest) { + final SwitchUnit unit = unitRequest.getUnit(); final Message message = unitRequest.getMessage(); - final Set> nextUnits = unitRequest.getUnit().getNextUnits(); + + final Set> nextUnits = unit.getNextUnits(); return Responder.nextUnit(message, nextUnits) .map(nextUnit -> { if (checkNotNull(nextUnit)) { return UnitRequest.of(nextUnit, message); } - return null; + return UnitRequest.of(unit, message); }); }