From 7db434bfa94171bdafebd173ddeef5eb6b7db59c Mon Sep 17 00:00:00 2001 From: Giteabot Date: Fri, 3 May 2024 10:17:11 +0800 Subject: [PATCH] Fix JS error on pull request page (#30838) (#30841) Backport #30838 by silverwind Fix this error seen on PR page, regression from https://github.com/go-gitea/gitea/pull/30803: Co-authored-by: silverwind 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 670e60def..b65938b04 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);