Мелкий рефакторинг

This commit is contained in:
Mark Struchkov 2019-05-17 00:32:37 +03:00
parent f017148ef7
commit 659c9cf2ad

View File

@ -53,7 +53,7 @@ public class Autoresponder {
} catch (NotFoundUnitException e) { } catch (NotFoundUnitException e) {
unit = defaultUnit; unit = defaultUnit;
} }
return unit; return Optional.ofNullable(unit).orElseThrow(NotFoundUnitException::new);
} }
private Unit nextUnit(Set<Unit> nextUnits, String message) { private Unit nextUnit(Set<Unit> nextUnits, String message) {