diff --git a/cla-backend/cla/models/github_models.py b/cla-backend/cla/models/github_models.py index c5fa82fd1..521bbe7c8 100644 --- a/cla-backend/cla/models/github_models.py +++ b/cla-backend/cla/models/github_models.py @@ -538,6 +538,9 @@ def get_github_user_by_email(self, email, installation_id): try: cla.log.debug('Searching for GitHub user by email handle: %s', email) users_by_email = self.client.search_users(f"{email} in:email") + if len(users_by_email) == 0: + cla.log.debug('No GitHub user found with email handle: %s', email) + return None return users_by_email[0] except UnknownObjectException: cla.log.error('Could not find GitHub user %s' ,