Skip to content

Commit 1e751d8

Browse files
authored
Fix JS error when dropping a file to a editor without dropzone (#32804)
`dropzoneEl` may not exist
1 parent dfd7594 commit 1e751d8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

web_src/js/features/comp/EditorUpload.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ export function initTextareaEvents(textarea, dropzoneEl) {
178178
});
179179
textarea.addEventListener('drop', (e) => {
180180
if (!e.dataTransfer.files.length) return;
181+
if (!dropzoneEl) return;
181182
handleUploadFiles(new TextareaEditor(textarea), dropzoneEl, e.dataTransfer.files, e);
182183
});
183184
dropzoneEl?.dropzone.on(DropzoneCustomEventRemovedFile, ({fileUuid}) => {

0 commit comments

Comments
 (0)