diff --git a/packages/cli-kit/src/public/node/themes/utils.ts b/packages/cli-kit/src/public/node/themes/utils.ts index bee6ad98ed8..168453038a3 100644 --- a/packages/cli-kit/src/public/node/themes/utils.ts +++ b/packages/cli-kit/src/public/node/themes/utils.ts @@ -27,9 +27,10 @@ export function composeThemeGid(id: number): string { } export function parseGid(gid: string): number { - const matches = GID_REGEXP.exec(gid) - if (matches && matches[1] !== undefined) { - return parseInt(matches[1], 10) + const match = GID_REGEXP.exec(gid)?.[1] + if (match === undefined) { + throw new Error(`Invalid GID: ${gid}`) } - throw new Error(`Invalid GID: ${gid}`) + + return parseInt(match, 10) }