summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/de/bwlehrpool/bwlp_guac/TunnelListener.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/de/bwlehrpool/bwlp_guac/TunnelListener.java b/src/main/java/de/bwlehrpool/bwlp_guac/TunnelListener.java
index 14f9c3a..5ed8927 100644
--- a/src/main/java/de/bwlehrpool/bwlp_guac/TunnelListener.java
+++ b/src/main/java/de/bwlehrpool/bwlp_guac/TunnelListener.java
@@ -46,8 +46,9 @@ public class TunnelListener implements Listener {
synchronized (userTunnelCount) {
count = userTunnelCount.get(username);
if (count != null) {
- if (count > 1) {
- userTunnelCount.put(username, count - 1);
+ count -= 1;
+ if (count > 0) {
+ userTunnelCount.put(username, count);
} else {
userTunnelCount.remove(username);
}