From 61325c65c5b8549fbc05144ba533fe60ddd7853b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 11 Sep 2024 14:21:10 +0300 Subject: fixes #4643 (Newest Update crashes miranda) --- libs/libjson/src/libJSON.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'libs/libjson/src') diff --git a/libs/libjson/src/libJSON.cpp b/libs/libjson/src/libJSON.cpp index 3dd7544afa..e52af2b6db 100644 --- a/libs/libjson/src/libJSON.cpp +++ b/libs/libjson/src/libJSON.cpp @@ -39,6 +39,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "JSONWorker.h" +#include "m_netlib.h" + #ifdef JSON_MEMORY_MANAGE auto_expand StringHandler; auto_expand_node NodeHandler; @@ -93,7 +95,13 @@ JSONNode JSONNode::parse(const json_char *str) if (str == nullptr) return JSONNode(); - return JSONWorker::parse(str); + try { + return JSONWorker::parse(str); + } + catch (...) { + Netlib_Logf(0, "Exception in uncrunching JSON from string: %s", str); + } + return JSONNode(); } LIBJSON_DLL(JSONNode*) json_parse(const json_char *json) { -- cgit v1.2.3