From c4e875402bd8e787c21bbd4ea07cbb69a8ceef27 Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 3 May 2024 04:12:10 +0200 Subject: [PATCH] Fix JS error on pull request page (#30838) Fix this error seen on PR page, regression from https://github.com/go-gitea/gitea/pull/30803: Co-authored-by: wxiaoguang --- web_src/js/features/repo-legacy.js | 1 + 1 file changed, 1 insertion(+) diff --git a/web_src/js/features/repo-legacy.js b/web_src/js/features/repo-legacy.js index 670e60def0..b65938b045 100644 --- a/web_src/js/features/repo-legacy.js +++ b/web_src/js/features/repo-legacy.js @@ -57,6 +57,7 @@ export function initRepoCommentForm() { function initBranchSelector() { const elSelectBranch = document.querySelector('.ui.dropdown.select-branch'); + if (!elSelectBranch) return; const isForNewIssue = elSelectBranch.getAttribute('data-for-new-issue') === 'true'; const $selectBranch = $(elSelectBranch);