mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 13:57:41 -08:00
Check that the id key exists to prevent any weird edge cases for location
This commit is contained in:
parent
04d2542b81
commit
d60c9800c2
|
@ -191,7 +191,7 @@ class LdapSync extends Command
|
||||||
$user->location_id = $item['location_id'];
|
$user->location_id = $item['location_id'];
|
||||||
} elseif ((isset($location)) && (!empty($location))) {
|
} elseif ((isset($location)) && (!empty($location))) {
|
||||||
|
|
||||||
if (is_array($location)) {
|
if ((is_array($location)) && (array_key_exists('id', $location))) {
|
||||||
$user->location_id = $location['id'];
|
$user->location_id = $location['id'];
|
||||||
} elseif (is_object($location)) {
|
} elseif (is_object($location)) {
|
||||||
$user->location_id = $location->id;
|
$user->location_id = $location->id;
|
||||||
|
|
Loading…
Reference in a new issue