From 0450eb51a10da9147db30677e312b4627df8f689 Mon Sep 17 00:00:00 2001 From: 21pages Date: Tue, 20 Jun 2023 18:15:54 +0800 Subject: [PATCH] fix JSON parse empty string Signed-off-by: 21pages --- src/ui/common.tis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/common.tis b/src/ui/common.tis index 932c6e76a..c82fd62c3 100644 --- a/src/ui/common.tis +++ b/src/ui/common.tis @@ -427,7 +427,7 @@ function httpRequest(url, type, params, _onSuccess, _onError, headers="") { if (status == " ") self.timer(0.1s, check_status); else { try { - var data = JSON.parse(status); + var data = JSON.parse(status || "{}"); _onSuccess(data); } catch (e) { _onError(status, 0);