Put guard around assigning location via LDAP

This commit is contained in:
Brady Wetherington 2023-08-02 15:01:14 +01:00
parent 924f5287f7
commit 0af205dade

View file

@ -243,7 +243,7 @@ class LdapSync extends Command
$user->jobtitle = $item['jobtitle']; $user->jobtitle = $item['jobtitle'];
$user->country = $item['country']; $user->country = $item['country'];
$user->department_id = $department->id; $user->department_id = $department->id;
$user->location_id = $location->id; $user->location_id = $location ? $location->id : null;
if($item['manager'] != null) { if($item['manager'] != null) {
// Check Cache first // Check Cache first