vault might be undefined

This commit is contained in:
fyears
2024-01-14 16:19:00 +08:00
parent 1e33f8b7d2
commit 37a801332f
3 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -699,8 +699,8 @@ export const uploadToRemote = async (
let mtime = 0;
let ctime = 0;
const s = await vault.adapter.stat(fileOrFolderPath);
if (s !== null) {
const s = await vault?.adapter?.stat(fileOrFolderPath);
if (s !== undefined && s !== null) {
mtime = s.mtime;
ctime = s.ctime;
}