fix access undefined when no files in folder

This commit is contained in:
2022-06-12 00:24:28 +08:00
parent 212ab56722
commit a9c2c2d7f9

View File

@@ -27,8 +27,10 @@ function FilesInFolder(props) {
alert(data.error);
} else {
setFiles(data.files);
if (data.files.length > 0) {
setNewFoldername(data.files[0].foldername);
}
}
})
.catch((error) => alert(error))
.finally(() => {