Skip to content

Commit a1bbaf8

Browse files
committed
fix null errors on conversation holder
1 parent 5242e52 commit a1bbaf8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

web_src/js/features/repo-issue.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,12 @@ export function initRepoIssueCommentDelete() {
187187
const path = conversationHolder.getAttribute('data-path');
188188
const side = conversationHolder.getAttribute('data-side');
189189
const idx = conversationHolder.getAttribute('data-idx');
190-
const lineType = conversationHolder.closest('tr').getAttribute('data-line-type');
190+
const lineType = conversationHolder.closest('tr')?.getAttribute('data-line-type');
191191

192192
if (lineType === 'same') {
193-
document.querySelector(`[data-path="${path}"] .add-code-comment[data-idx="${idx}"]`).classList.remove('tw-invisible');
193+
document.querySelector(`[data-path="${path}"] .add-code-comment[data-idx="${idx}"]`)?.classList.remove('tw-invisible');
194194
} else {
195-
document.querySelector(`[data-path="${path}"] .add-code-comment[data-side="${side}"][data-idx="${idx}"]`).classList.remove('tw-invisible');
195+
document.querySelector(`[data-path="${path}"] .add-code-comment[data-side="${side}"][data-idx="${idx}"]`)?.classList.remove('tw-invisible');
196196
}
197197

198198
conversationHolder.remove();

0 commit comments

Comments
 (0)