Skip to content

Commit 912fe6f

Browse files
reggie-kcrenshaw-devRy0taK
authored
Merge commit from fork (#399)
Fix shadowed variable name Signed-off-by: Ry0taK <49341894+Ry0taK@users.noreply.github.com> Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Co-authored-by: Ry0taK <49341894+Ry0taK@users.noreply.github.com>
1 parent 6e4ca19 commit 912fe6f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • ui/src/app/shared/components

ui/src/app/shared/components/urls.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {GitUrl} from 'git-url-parse';
22
import {isSHA} from './revision';
3+
import {isValidURL} from '../../shared/utils';
34

45
const GitUrlParse = require('git-url-parse');
56

@@ -19,7 +20,11 @@ export function repoUrl(url: string): string {
1920
return null;
2021
}
2122

22-
return `${protocol(parsed.protocol)}://${parsed.resource}/${parsed.owner}/${parsed.name}`;
23+
const parsedUrl = `${protocol(parsed.protocol)}://${parsed.resource}/${parsed.owner}/${parsed.name}`;
24+
if (!isValidURL(parsedUrl)) {
25+
return null;
26+
}
27+
return parsedUrl;
2328
} catch {
2429
return null;
2530
}

0 commit comments

Comments
 (0)