diff --git a/src/api.ts b/src/api.ts index 0fcd147..0fa2013 100644 --- a/src/api.ts +++ b/src/api.ts @@ -308,8 +308,12 @@ export async function getFile(path: string): Promise { path: path } let url = '/api/file/getFile'; - let file = await fetchSyncPost(url, data); - return file; + try { + let file = await fetchSyncPost(url, data); + return file; + } catch (error_msg) { + return null; + } } export async function putFile(path: string, isDir: boolean, file: any) {