From a257b15f86448785b4124e594a6d565ab2334955 Mon Sep 17 00:00:00 2001 From: shbatm Date: Fri, 4 Jan 2019 09:23:10 -0600 Subject: [PATCH] Error handling for bad git data in updatenotification Update CHANGELOG --- CHANGELOG.md | 1 + modules/default/updatenotification/node_helper.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d47f3fa771..d5c35403cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - Fixed temperature displays in currentweather and weatherforecast modules [#1503](https://github.com/MichMich/MagicMirror/issues/1503). +- Fixed unhandled error on bad git data in updatenotiifcation module [#1285](https://github.com/MichMich/MagicMirror/issues/1285). ## [2.6.0] - 2019-01-01 diff --git a/modules/default/updatenotification/node_helper.js b/modules/default/updatenotification/node_helper.js index df989faa36..9d27875167 100644 --- a/modules/default/updatenotification/node_helper.js +++ b/modules/default/updatenotification/node_helper.js @@ -65,8 +65,10 @@ module.exports = NodeHelper.create({ data.module = sg.module; if (!err) { sg.git.log({"-1": null}, function(err, data2) { - data.hash = data2.latest.hash; - self.sendSocketNotification("STATUS", data); + if (!err) { + data.hash = data2.latest.hash; + self.sendSocketNotification("STATUS", data); + } }); } });