Skip to content

Commit 151b786

Browse files
authored
Fix dropzone JS error when attachment is disabled (#31486)
Fix #31485
1 parent 58b1ee5 commit 151b786

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

web_src/js/features/repo-issue-edit.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ async function onEditContent(event) {
125125
content: comboMarkdownEditor.value(),
126126
context: editContentZone.getAttribute('data-context'),
127127
});
128-
for (const fileInput of dropzoneInst?.element.querySelectorAll('.files [name=files]')) params.append('files[]', fileInput.value);
128+
for (const fileInput of dropzoneInst?.element.querySelectorAll('.files [name=files]') ?? []) {
129+
params.append('files[]', fileInput.value);
130+
}
129131

130132
const response = await POST(editContentZone.getAttribute('data-update-url'), {data: params});
131133
const data = await response.json();

0 commit comments

Comments
 (0)