diff --git a/app/Console/Commands/LdapSync.php b/app/Console/Commands/LdapSync.php index 7b7571bf40..4ec7509d15 100755 --- a/app/Console/Commands/LdapSync.php +++ b/app/Console/Commands/LdapSync.php @@ -191,7 +191,7 @@ class LdapSync extends Command $user->location_id = $item['location_id']; } elseif ((isset($location)) && (!empty($location))) { - if (is_array($location)) { + if ((is_array($location)) && (array_key_exists('id', $location))) { $user->location_id = $location['id']; } elseif (is_object($location)) { $user->location_id = $location->id;