diff options
author | Simon Rettberg | 2020-07-20 17:18:52 +0200 |
---|---|---|
committer | Simon Rettberg | 2020-07-20 17:18:52 +0200 |
commit | a70a3d451a9161b0cc74ced675d747d8c404d0bc (patch) | |
tree | 7fbc58433938e55d395bbad93a068b8fb7adf7dd | |
parent | Remove pointless code (diff) | |
download | bwlp-guacamole-ext-a70a3d451a9161b0cc74ced675d747d8c404d0bc.tar.gz bwlp-guacamole-ext-a70a3d451a9161b0cc74ced675d747d8c404d0bc.tar.xz bwlp-guacamole-ext-a70a3d451a9161b0cc74ced675d747d8c404d0bc.zip |
Add sanity check, fix array compare
-rw-r--r-- | src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java b/src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java index 6216389..4bc653b 100644 --- a/src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java +++ b/src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java @@ -207,6 +207,8 @@ public class ConnectionManager { synchronized (groupPool) { HashSet<JsonGroup> processedGroups = new HashSet<JsonGroup>(); for (JsonGroup gnew : groups) { + if (gnew.locationids == null) + continue; JsonGroup existing = groupPool.get(gnew.id); boolean redoClientMapping = false; if (existing == null) { @@ -214,8 +216,10 @@ public class ConnectionManager { existing = gnew; redoClientMapping = true; } else { - if (existing.locationids != gnew.locationids) redoClientMapping = true; - existing.locationids = gnew.locationids; + if (!Arrays.equals(existing.locationids, gnew.locationids)) { + redoClientMapping = true; + existing.locationids = gnew.locationids; + } existing.name = gnew.name; existing.password = gnew.password; } |