diff --git a/packages/form-js-viewer/src/render/components/form-fields/FilePicker.js b/packages/form-js-viewer/src/render/components/form-fields/FilePicker.js index f5b540f5d..06f87188c 100644 --- a/packages/form-js-viewer/src/render/components/form-fields/FilePicker.js +++ b/packages/form-js-viewer/src/render/components/form-fields/FilePicker.js @@ -43,7 +43,7 @@ export function FilePicker(props) { const selectedFiles = fileRegistry === null ? EMPTY_ARRAY : fileRegistry.getFiles(filesKey); useEffect(() => { - if (filesKey.length > 0 && fileRegistry !== null && !fileRegistry.hasKey(filesKey)) { + if (filesKey && fileRegistry !== null && !fileRegistry.hasKey(filesKey)) { onChange({ value: null }); } }, [fileRegistry, filesKey, onChange, selectedFiles.length]);