Skip to content

A free open source IT asset/license management system

Whoops, we were doing something similar with email

Brady Wetherington7572585e42e9
diff --git a/app/Models/SnipeSCIMConfig.php b/app/Models/SnipeSCIMConfig.php
index d2a0e09304..161df9cf16 100644
--- a/app/Models/SnipeSCIMConfig.php
+++ b/app/Models/SnipeSCIMConfig.php
@@ -377,13 +377,14 @@ class SnipeSCIMConfig
{
protected function doRead(&$object, $attributes = [])
{
- return collect([$object->email])->map(function ($email) {
- return [
- 'value' => $email,
- 'type' => 'work', // TODO - is this how we always have done it?
- 'primary' => true,
- ];
- })->toArray();
+ if (!$object->email) {
+ return null;
+ }
+ return [
+ 'value' => $object->email,
+ 'type' => 'work', // TODO - is this how we always have done it?
+ 'primary' => true,
+ ];
}
public function doWrite($operation, $subop, $value, Model &$object, ?Path $path = null, $removeIfNotSet = false)