diff --git a/gradle/changelog/submodule_without_http.yaml b/gradle/changelog/submodule_without_http.yaml new file mode 100644 index 0000000000..4c90813179 --- /dev/null +++ b/gradle/changelog/submodule_without_http.yaml @@ -0,0 +1,2 @@ +- type: fixed + description: Source view with submodules without http or https URL diff --git a/scm-ui/ui-webapp/src/repos/sources/components/content/FileLink.tsx b/scm-ui/ui-webapp/src/repos/sources/components/content/FileLink.tsx index e8fee16950..6b1eb124df 100644 --- a/scm-ui/ui-webapp/src/repos/sources/components/content/FileLink.tsx +++ b/scm-ui/ui-webapp/src/repos/sources/components/content/FileLink.tsx @@ -36,6 +36,9 @@ type Props = { }; const getHostname = (repositoryUrl: string) => { + if (!repositoryUrl.startsWith("http://") && !repositoryUrl.startsWith("https://")) { + return undefined; + } let host = repositoryUrl.split("/")[2]; if (host.includes("@")) { // remove prefix