Skip to content

Commit

Permalink
Fix updatenotification (#3281)
Browse files Browse the repository at this point in the history
Sometime, `pm2 jlist` don't send an json reponse
Catch error if happen

---------

Co-authored-by: bugsounet <[email protected]>
  • Loading branch information
bugsounet and bugsounet authored Dec 4, 2023
1 parent e77f10b commit 7485438
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,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

Expand Down
10 changes: 8 additions & 2 deletions modules/default/updatenotification/update_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
});
}
Expand Down

0 comments on commit 7485438

Please sign in to comment.