Open
Description
export const getRepoCodeHostInfo = (repo?: Repository): CodeHostInfo | undefined => {
if (!repo) {
return undefined;
}
const hostType = repo.RawConfig ? repo.RawConfig['web-url-type'] : undefined;
if (!hostType) {
return undefined;
}
const url = new URL(repo.URL);
const displayName = url.pathname.slice(1);
If a host provides an invalid web-url and the new URL(repo.URL);
fails, this crashes the page. I think we should catch this and not provide a link if it is null.