Skip to content

Commit ba122c9

Browse files
committed
fix js error
1 parent 730ef3e commit ba122c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

web_src/js/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function parseIssueHref(href: string): IssuePathInfo {
4040
export function parseIssueNewHref(href: string): IssuePathInfo {
4141
const path = (href || '').replace(/[#?].*$/, '');
4242
const [_, ownerName, repoName, pathTypeField] = /([^/]+)\/([^/]+)\/(issues\/new|compare\/.+\.\.\.)/.exec(path) || [];
43-
const pathType = pathTypeField.startsWith('issues/new') ? 'issues' : 'pulls';
43+
const pathType = pathTypeField ? pathTypeField.startsWith('issues/new') ? 'issues' : 'pulls' : undefined;
4444
return {ownerName, repoName, pathType};
4545
}
4646

0 commit comments

Comments
 (0)