From a70a3d451a9161b0cc74ced675d747d8c404d0bc Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 20 Jul 2020 17:18:52 +0200 Subject: Add sanity check, fix array compare --- src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java | 8 ++++++-- 1 file 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 processedGroups = new HashSet(); 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; } -- cgit v1.2.3-55-g7522