From 278b81a8fb26f9e75501526145750bec86535e29 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 27 Mar 2024 23:14:18 -0400 Subject: [PATCH] fix: Handle github.com links that are not resources --- plugins/github/server/github.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/github/server/github.ts b/plugins/github/server/github.ts index d8ad10348..1ed8147ea 100644 --- a/plugins/github/server/github.ts +++ b/plugins/github/server/github.ts @@ -186,11 +186,12 @@ export class GitHub { const parts = pathname.split("/"); const owner = parts[1]; const repo = parts[2]; - const type = pluralize.singular(parts[3]) as Resource; + const type = parts[3] + ? (pluralize.singular(parts[3]) as Resource) + : undefined; const id = parts[4]; - if (!GitHub.supportedResources.includes(type)) { - Logger.warn(`Unsupported GitHub resource type: ${type}`); + if (!type || !GitHub.supportedResources.includes(type)) { return; }