diff --git a/web_src/js/features/comp/EditorUpload.ts b/web_src/js/features/comp/EditorUpload.ts index b1f49cbe92..89982747ea 100644 --- a/web_src/js/features/comp/EditorUpload.ts +++ b/web_src/js/features/comp/EditorUpload.ts @@ -178,6 +178,7 @@ export function initTextareaEvents(textarea, dropzoneEl) { }); textarea.addEventListener('drop', (e) => { if (!e.dataTransfer.files.length) return; + if (!dropzoneEl) return; handleUploadFiles(new TextareaEditor(textarea), dropzoneEl, e.dataTransfer.files, e); }); dropzoneEl?.dropzone.on(DropzoneCustomEventRemovedFile, ({fileUuid}) => {