summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2020-07-20 17:18:52 +0200
committerSimon Rettberg2020-07-20 17:18:52 +0200
commita70a3d451a9161b0cc74ced675d747d8c404d0bc (patch)
tree7fbc58433938e55d395bbad93a068b8fb7adf7dd
parentRemove pointless code (diff)
downloadbwlp-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.java8
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;
}