diff --git a/web_src/js/components/ViewFileTreeStore.ts b/web_src/js/components/ViewFileTreeStore.ts index 936db07776..4237f7e323 100644 --- a/web_src/js/components/ViewFileTreeStore.ts +++ b/web_src/js/components/ViewFileTreeStore.ts @@ -20,6 +20,9 @@ export function createViewFileTreeStore(props: {repoLink: string, treePath: stri selectedItem: props.treePath, async loadChildren(treePath: string, subPath: string = '') { + // there is no git ref if no commits were made yet (an empty repo) + if (!props.currentRefNameSubURL) return null; + const response = await GET(`${props.repoLink}/tree-view/${props.currentRefNameSubURL}/${pathEscapeSegments(treePath)}?sub_path=${encodeURIComponent(subPath)}`); const json = await response.json(); const poolSvgs = [];