Skip to content

Commit 8eb2171

Browse files
CustomConnectionMonitor: add null checks
1 parent 7a1751d commit 8eb2171

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/main/java/ssh/CustomConnectionMonitor.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ public void connectionLost(Throwable reason) {
3030
return;
3131
}
3232

33-
app.getHttpProxy().stop();
33+
if (app.getHttpProxy() != null) {
34+
app.getHttpProxy().stop();
35+
}
3436

3537
Logger.getLogger(CustomConnectionMonitor.class.getName()).log(Level.SEVERE,
3638
String.format("[%s] SSH Connection lost! %s", tunnel.getConnectionId(), reason.getMessage()));
@@ -61,7 +63,9 @@ public void run() {
6163
retrying = false;
6264
timer.cancel();
6365

64-
app.getHttpProxy().start();
66+
if (app.getHttpProxy() != null) {
67+
app.getHttpProxy().start();
68+
}
6569
tunnel.createPortForwarding();
6670

6771
Logger.getLogger(CustomConnectionMonitor.class.getName()).log(Level.INFO,

0 commit comments

Comments
 (0)