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