Skip to content

Commit 497012d

Browse files
committed
handling edge case
1 parent 3e1593a commit 497012d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

web_src/js/components/ViewFileTreeStore.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export function createViewFileTreeStore(props: {repoLink: string, treePath: stri
3131
const elViewContent = document.querySelector('.repo-view-content');
3232
elViewContent.innerHTML = await response.text();
3333
const elViewContentData = elViewContent.querySelector('.repo-view-content-data');
34+
if (!elViewContentData) return; // if error occurs, there is no such element
3435
const t1 = elViewContentData.getAttribute('data-document-title');
3536
const t2 = elViewContentData.getAttribute('data-document-title-common');
3637
document.title = `${t1} - ${t2}`; // follow the format in head.tmpl: <head><title>...</title></head>

0 commit comments

Comments
 (0)