Skip to content

Commit

Permalink
fix: handle null
Browse files Browse the repository at this point in the history
  • Loading branch information
vsgoulart committed Sep 9, 2024
1 parent e5ace5e commit da9fa18
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit da9fa18

Please sign in to comment.