diff --git a/main/ui/src/main/java/org/cryptomator/ui/controllers/MainController.java b/main/ui/src/main/java/org/cryptomator/ui/controllers/MainController.java index 2df9a1926..76f069388 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/controllers/MainController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/controllers/MainController.java @@ -224,13 +224,13 @@ public class MainController implements ViewController { forceShutdownButtonType, forceShutdownButtonType, tryAgainButtonType); Optional choice = gracefulShutdownDialog.showAndWait(); - if (choice.isPresent()) { - if (tryAgainButtonType.equals(choice.get())) { + choice.ifPresent(btnType -> { + if (tryAgainButtonType.equals(btnType)) { gracefulShutdown(); - } else if (forceShutdownButtonType.equals(choice.get())) { + } else if (forceShutdownButtonType.equals(btnType)) { Platform.runLater(Platform::exit); } - } + }); } }