fix #1964 – error when selecting no files to import after previously selecting files
This commit is contained in:
parent
eff56b758c
commit
a427d77076
@ -85,6 +85,12 @@ function CollectionMenu({
|
||||
async (ev: SyntheticEvent<>) => {
|
||||
const files = getDataTransferFiles(ev);
|
||||
|
||||
// Because this is the onChange handler it's possible for the change to be
|
||||
// from previously selecting a file to not selecting a file – aka empty
|
||||
if (!files.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const file = files[0];
|
||||
const document = await documents.import(file, null, collection.id, {
|
||||
|
Reference in New Issue
Block a user