vault might be undefined
This commit is contained in:
parent
1e33f8b7d2
commit
37a801332f
@ -542,8 +542,8 @@ export const uploadToRemote = async (
|
|||||||
|
|
||||||
let mtime = 0;
|
let mtime = 0;
|
||||||
let ctime = 0;
|
let ctime = 0;
|
||||||
const s = await vault.adapter.stat(fileOrFolderPath);
|
const s = await vault?.adapter?.stat(fileOrFolderPath);
|
||||||
if (s !== null) {
|
if (s !== undefined && s !== null) {
|
||||||
mtime = Math.round(s.mtime / 1000.0) * 1000;
|
mtime = Math.round(s.mtime / 1000.0) * 1000;
|
||||||
ctime = Math.round(s.ctime / 1000.0) * 1000;
|
ctime = Math.round(s.ctime / 1000.0) * 1000;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -699,8 +699,8 @@ export const uploadToRemote = async (
|
|||||||
|
|
||||||
let mtime = 0;
|
let mtime = 0;
|
||||||
let ctime = 0;
|
let ctime = 0;
|
||||||
const s = await vault.adapter.stat(fileOrFolderPath);
|
const s = await vault?.adapter?.stat(fileOrFolderPath);
|
||||||
if (s !== null) {
|
if (s !== undefined && s !== null) {
|
||||||
mtime = s.mtime;
|
mtime = s.mtime;
|
||||||
ctime = s.ctime;
|
ctime = s.ctime;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -366,8 +366,8 @@ export const uploadToRemote = async (
|
|||||||
// folder
|
// folder
|
||||||
let mtime = 0;
|
let mtime = 0;
|
||||||
let ctime = 0;
|
let ctime = 0;
|
||||||
const s = await vault.adapter.stat(fileOrFolderPath);
|
const s = await vault?.adapter?.stat(fileOrFolderPath);
|
||||||
if (s !== null) {
|
if (s !== undefined && s !== null) {
|
||||||
mtime = s.mtime;
|
mtime = s.mtime;
|
||||||
ctime = s.ctime;
|
ctime = s.ctime;
|
||||||
}
|
}
|
||||||
@ -408,8 +408,8 @@ export const uploadToRemote = async (
|
|||||||
ctime = rawContentCTime;
|
ctime = rawContentCTime;
|
||||||
} else {
|
} else {
|
||||||
localContent = await vault.adapter.readBinary(fileOrFolderPath);
|
localContent = await vault.adapter.readBinary(fileOrFolderPath);
|
||||||
const s = await vault.adapter.stat(fileOrFolderPath);
|
const s = await vault?.adapter?.stat(fileOrFolderPath);
|
||||||
if (s !== null) {
|
if (s !== undefined && s !== null) {
|
||||||
mtime = s.mtime;
|
mtime = s.mtime;
|
||||||
ctime = s.ctime;
|
ctime = s.ctime;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user