From b123306235c669286b581efae59ce58a73ad1e25 Mon Sep 17 00:00:00 2001 From: Marc Vilanova Date: Mon, 20 Mar 2023 11:42:03 -0700 Subject: [PATCH] Returns empty list if Google group has no members --- src/dispatch/plugins/dispatch_google/groups/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dispatch/plugins/dispatch_google/groups/plugin.py b/src/dispatch/plugins/dispatch_google/groups/plugin.py index fdc234698e1b..29a04473fb89 100644 --- a/src/dispatch/plugins/dispatch_google/groups/plugin.py +++ b/src/dispatch/plugins/dispatch_google/groups/plugin.py @@ -159,7 +159,7 @@ def list(self, email: str): """Lists members from an existing Google Group.""" client = get_service(self.configuration, "admin", "directory_v1", self.scopes) members = list_members(client, email) - return [m["email"] for m in members["members"]] + return [m["email"] for m in members.get("members", [])] def delete(self, email: str): """Deletes an existing Google group."""