Skip to content

Commit a5b4041

Browse files
authored
Merge commit from fork
Fix shadowed variable name Signed-off-by: Ry0taK <[email protected]>
1 parent 18ce5c2 commit a5b4041

File tree

1 file changed

+6
-1
lines changed
  • ui/src/app/shared/components

1 file changed

+6
-1
lines changed

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)