Skip to content

Commit

Permalink
Check if those things are set.
Browse files Browse the repository at this point in the history
(Perils of moving away from the loose `empty()`!)
  • Loading branch information
Adambean committed Dec 14, 2024
1 parent 599d8bf commit 0fdd389
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/LdapSyncCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,7 @@ private function deployGitlabUsersAndGroups(array $config, string $gitlabInstanc
continue;
}

if ("" !== $usersSync["new"][$gitlabUserId]) {
if (isset($usersSync["new"][$gitlabUserId]) && "" !== $usersSync["new"][$gitlabUserId]) {
continue;
}

Expand Down Expand Up @@ -1772,7 +1772,10 @@ private function deployGitlabUsersAndGroups(array $config, string $gitlabInstanc
// Update groups of which were already in both Gitlab and the directory
$this->logger?->notice("Updating groups of which were already in both Gitlab and the directory...");
foreach ($groupsSync["found"] as $gitlabGroupId => $gitlabGroupName) {
if ("" !== $groupsSync["new"][$gitlabGroupId] || "" !== $groupsSync["extra"][$gitlabGroupId]) {
if (
(isset($groupsSync["new"][$gitlabGroupId]) && "" !== $groupsSync["new"][$gitlabGroupId])
|| (isset($groupsSync["extra"][$gitlabGroupId]) && "" !== $groupsSync["extra"][$gitlabGroupId])
) {
continue;
}

Expand Down

0 comments on commit 0fdd389

Please sign in to comment.