Исправил баг в SwitchUnitAction

This commit is contained in:
Struchkov Mark 2023-05-03 01:22:09 +03:00
parent 5f97e5e47e
commit b23f5dc914
Signed by: upagge
GPG Key ID: D3018BE7BA428CA6

View File

@ -15,14 +15,16 @@ public class SwitchUnitAction implements ActionUnit<SwitchUnit<Message>, Message
@Override
public Uni<UnitRequest<MainUnit, Message>> action(UnitRequest<SwitchUnit<Message>, Message> unitRequest) {
final SwitchUnit<Message> unit = unitRequest.getUnit();
final Message message = unitRequest.getMessage();
final Set<MainUnit<Message>> nextUnits = unitRequest.getUnit().getNextUnits();
final Set<MainUnit<Message>> 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);
});
}