diff --git a/src/main/java/io/bitsquare/app/gui/BitsquareApp.java b/src/main/java/io/bitsquare/app/gui/BitsquareApp.java index 1160edffce..9cc7c2e23f 100644 --- a/src/main/java/io/bitsquare/app/gui/BitsquareApp.java +++ b/src/main/java/io/bitsquare/app/gui/BitsquareApp.java @@ -105,7 +105,7 @@ public class BitsquareApp extends Application { // configure the system tray SystemTray systemTray = new SystemTray(primaryStage, this::stop); - primaryStage.setOnCloseRequest(e -> systemTray.hideStage()); + primaryStage.setOnCloseRequest(e -> stop()); scene.setOnKeyReleased(keyEvent -> { // For now we exit when closing/quit the app. // Later we will only hide the window (systemTray.hideStage()) and use the exit item in the system tray for diff --git a/src/main/java/io/bitsquare/msg/tomp2p/TomP2PNode.java b/src/main/java/io/bitsquare/msg/tomp2p/TomP2PNode.java index 5416fbabdb..0ee9cf5a77 100644 --- a/src/main/java/io/bitsquare/msg/tomp2p/TomP2PNode.java +++ b/src/main/java/io/bitsquare/msg/tomp2p/TomP2PNode.java @@ -140,8 +140,8 @@ public class TomP2PNode { public void shutDown() { - if (peerDHT != null && peerDHT.peer() != null) - peerDHT.peer().shutdown(); + if (peerDHT != null) + peerDHT.shutdown(); } public PeerDHT getPeerDHT() {