Skip to content

A free open source IT asset/license management system

For empty addresses, we were returning empty arrays instead of skipping

Brady Wetheringtond81360f15ec8
diff --git a/app/Models/SnipeSCIMConfig.php b/app/Models/SnipeSCIMConfig.php
index 62b45a871c..d2a0e09304 100644
--- a/app/Models/SnipeSCIMConfig.php
+++ b/app/Models/SnipeSCIMConfig.php
@@ -502,8 +502,11 @@ class SnipeSCIMConfig
$address['type'] = 'work';
$address['primary'] = true;
}
-
- return [$address];
+ if ($address) {
+ return [(object) $address]; //cast-to-object forces "squiggly-brackets" in JSON
+ } else {
+ return null; //this should remove the addresses block entirely
+ }
}
public function doWrite($operation, $subop, $value, Model &$object, ?Path $path = null, $removeIfNotSet = false)