From 9d4cce22d0c485dc54c98dbf189cf78507cba1b5 Mon Sep 17 00:00:00 2001 From: Jon Goldberg Date: Tue, 4 Apr 2023 14:29:17 -0400 Subject: [PATCH] error handling on mappings --- getmappings.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/getmappings.php b/getmappings.php index 3e2bfd2..ee45251 100755 --- a/getmappings.php +++ b/getmappings.php @@ -30,7 +30,9 @@ function writeDomains($projectsByDomain) { function writeUsers($projectsById, $membershipMapping) { $userHandle = fopen(__DIR__ . '/data/usermap.csv', 'w'); foreach ($membershipMapping as $email => $projectId) { - fwrite ($userHandle, "$email,{$projectsById[$projectId]}\n"); + if ($projectsById[$projectId] ?? FALSE) { + fwrite ($userHandle, "$email,{$projectsById[$projectId]}\n"); + } } // Handle special user cases. $specialUsers = fopen(__DIR__ . '/data/specialusers.csv', 'r');