From e28a21de795dc1ef93638bd62c717df939dd6a9d Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 23 May 2023 10:03:56 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/8329 --- app/src/util/fetch.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/util/fetch.ts b/app/src/util/fetch.ts index 22f43e0fc..c5bf85f1f 100644 --- a/app/src/util/fetch.ts +++ b/app/src/util/fetch.ts @@ -35,7 +35,7 @@ export const fetchPost = (url: string, data?: any, cb?: (response: IWebSocketDat code: response.status, }; } else { - if (response.headers.get("content-type").indexOf("application/json") > -1) { + if (response.headers.get("content-type")?.indexOf("application/json") > -1) { return response.json(); } else { return response.text();