fix: Handle github.com links that are not resources

This commit is contained in:
Tom Moor
2024-03-27 23:14:18 -04:00
parent 77716f3803
commit 278b81a8fb

View File

@@ -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;
}