]> source.dussan.org Git - gitea.git/commitdiff
Fix JS error on pull request page (#30838) (#30841)
authorGiteabot <teabot@gitea.io>
Fri, 3 May 2024 02:17:11 +0000 (10:17 +0800)
committerGitHub <noreply@github.com>
Fri, 3 May 2024 02:17:11 +0000 (02:17 +0000)
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 <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
web_src/js/features/repo-legacy.js

index 670e60def03b49be5a4e1a1f430bf3623f836dc0..b65938b045ac605b551c44de5b857f31fce56d44 100644 (file)
@@ -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);