From 0af205dade64957c89f579ec6bd5b8ce0d7334b4 Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Wed, 2 Aug 2023 15:01:14 +0100 Subject: [PATCH] Put guard around assigning location via LDAP --- app/Console/Commands/LdapSync.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Console/Commands/LdapSync.php b/app/Console/Commands/LdapSync.php index f77f5f8c48..d92bc1023b 100755 --- a/app/Console/Commands/LdapSync.php +++ b/app/Console/Commands/LdapSync.php @@ -243,7 +243,7 @@ class LdapSync extends Command $user->jobtitle = $item['jobtitle']; $user->country = $item['country']; $user->department_id = $department->id; - $user->location_id = $location->id; + $user->location_id = $location ? $location->id : null; if($item['manager'] != null) { // Check Cache first