From d60c9800c2b4e350a82993983670d1a6dfb3964a Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 5 Mar 2018 22:44:05 -0800 Subject: [PATCH] Check that the id key exists to prevent any weird edge cases for location --- 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 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;