From caf383dbd7660e646665e1905b73ccd9388d8982 Mon Sep 17 00:00:00 2001 From: bugsounet Date: Fri, 1 Dec 2023 13:38:18 +0100 Subject: [PATCH 1/2] catch error if result is not an json format --- modules/default/updatenotification/update_helper.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/default/updatenotification/update_helper.js b/modules/default/updatenotification/update_helper.js index 532472075c..41eb66b458 100644 --- a/modules/default/updatenotification/update_helper.js +++ b/modules/default/updatenotification/update_helper.js @@ -198,8 +198,14 @@ class Updater { resolve(null); return; } - let result = JSON.parse(std); - resolve(result); + try { + let result = JSON.parse(std); + resolve(result); + } catch (e) { + Log.error("updatenotification: [PM2] can't GetList!"); + Log.debug("updatenotification: [PM2] GetList is not an JSON format", e); + resolve(null); + } }); }); } From 4467c6b9303da4cab6a46888a13ce0be67fb3cc0 Mon Sep 17 00:00:00 2001 From: bugsounet Date: Fri, 1 Dec 2023 13:41:02 +0100 Subject: [PATCH 2/2] update change log --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6c4f71848..ce6dfb2693 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ _This release is scheduled to be released on 2024-01-01._ - Fix #3256 filter out bad results from rrule.between - Fix calendar events sometimes not respecting deleted events (#3250) - Fix electron loadurl locally on Windows when address "0.0.0.0" (#2550) +- Fix updatanotification (update_helper.js): catch error if reponse is not an JSON format (check PM2) ## [2.25.0] - 2023-10-01