From e18f12df1768843f1cfa386e27b1aaa08f505699 Mon Sep 17 00:00:00 2001 From: Justin Nesselrotte Date: Wed, 11 Sep 2024 12:07:12 -0600 Subject: [PATCH] Fixing empty members on email list --- app/External/Google/GroupApi.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/External/Google/GroupApi.php b/app/External/Google/GroupApi.php index 4eb644b7..495cfa82 100644 --- a/app/External/Google/GroupApi.php +++ b/app/External/Google/GroupApi.php @@ -95,6 +95,14 @@ public function list(?ApiProgress $apiProgress = null) ]); }, $apiProgress) ->filter(function($group) { + if(! is_array($group)) { // Groups with no members come back as just a string? + return false; + } + + if(! array_key_exists('type', $group)) { + return false; + } + return $group['type'] != 'CUSTOMER'; // No email key for this entry type }) ->map(function ($group) {