From 51aa5c99d5eff4f897faafccb6a176640083198d Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Thu, 16 May 2024 00:02:57 +0000 Subject: [PATCH] fix --- web_src/js/features/repo-issue.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index 8ee681aedc5f9..a28416c300dc0 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -638,8 +638,9 @@ export function initRepoIssueTitleEdit() { } } if (prTargetUpdateUrl) { - const newTargetBranch = document.querySelector('#pull-target-branch').getAttribute('data-branch'); - const oldTargetBranch = document.querySelector('#branch_target').textContent; + // merged pr can not edit target branch, so they maybe null + const newTargetBranch = document.querySelector('#pull-target-branch')?.getAttribute('data-branch'); + const oldTargetBranch = document.querySelector('#branch_target')?.textContent; if (newTargetBranch !== oldTargetBranch) { const resp = await POST(prTargetUpdateUrl, {data: new URLSearchParams({target_branch: newTargetBranch})}); if (!resp.ok) {