From 4058a2e59502915252ddc162aaadfc6c5eea65b0 Mon Sep 17 00:00:00 2001 From: "Cornelius A. Ludmann" Date: Fri, 18 Jun 2021 10:28:53 +0000 Subject: [PATCH] [gitlab] Handle `null` in avatar_url --- components/server/src/gitlab/gitlab-auth-provider.ts | 2 +- components/server/src/gitlab/gitlab-repository-provider.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/server/src/gitlab/gitlab-auth-provider.ts b/components/server/src/gitlab/gitlab-auth-provider.ts index 641a4747d3e910..31fd2f8f4cce92 100644 --- a/components/server/src/gitlab/gitlab-auth-provider.ts +++ b/components/server/src/gitlab/gitlab-auth-provider.ts @@ -79,7 +79,7 @@ export class GitLabAuthProvider extends GenericAuthProvider { authUser: { authId: String(id), authName: username, - avatarUrl: avatar_url, + avatarUrl: avatar_url || undefined, name, primaryEmail: email }, diff --git a/components/server/src/gitlab/gitlab-repository-provider.ts b/components/server/src/gitlab/gitlab-repository-provider.ts index 1f02bbad71c850..525a16020a1d07 100644 --- a/components/server/src/gitlab/gitlab-repository-provider.ts +++ b/components/server/src/gitlab/gitlab-repository-provider.ts @@ -25,7 +25,7 @@ export class GitlabRepositoryProvider implements RepositoryProvider { const cloneUrl = response.http_url_to_repo; const description = response.default_branch; const host = parseRepoUrl(cloneUrl)!.host; - const avatarUrl = response.owner.avatar_url; + const avatarUrl = response.owner.avatar_url || undefined; const webUrl = response.web_url; return { host, owner, name, cloneUrl, description, avatarUrl, webUrl }; }