Fix file upload handling in SftpView by adding a check for undefined files before uploading.

This commit is contained in:
liumangmang
2026-02-04 11:40:24 +08:00
parent 669dc11064
commit 1aefc14e42

View File

@@ -147,7 +147,9 @@ async function handleFileSelect(e: Event) {
const path = currentPath.value === '.' ? '' : currentPath.value
try {
for (let i = 0; i < selected.length; i++) {
await sftpApi.uploadFile(connectionId.value, path, selected[i])
const file = selected[i]
if (!file) continue
await sftpApi.uploadFile(connectionId.value, path, file)
}
loadPath()
} catch {