Skip to content

Commit 0fdd389

Browse files
committed
Check if those things are set.
(Perils of moving away from the loose `empty()`!)
1 parent 599d8bf commit 0fdd389

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/LdapSyncCommand.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,7 @@ private function deployGitlabUsersAndGroups(array $config, string $gitlabInstanc
14991499
continue;
15001500
}
15011501

1502-
if ("" !== $usersSync["new"][$gitlabUserId]) {
1502+
if (isset($usersSync["new"][$gitlabUserId]) && "" !== $usersSync["new"][$gitlabUserId]) {
15031503
continue;
15041504
}
15051505

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

0 commit comments

Comments
 (0)