diff --git a/BaseFiles/Common/html/pages/configure/programengine/_programslist.js b/BaseFiles/Common/html/pages/configure/programengine/_programslist.js
index 99b71f255..4ac13fffa 100644
--- a/BaseFiles/Common/html/pages/configure/programengine/_programslist.js
+++ b/BaseFiles/Common/html/pages/configure/programengine/_programslist.js
@@ -634,7 +634,8 @@ HG.WebApp.ProgramsList = HG.WebApp.ProgramsList || new function () { var $$ = th
editor3.markClean();
//
if (program.Type.toLowerCase() === 'wizard') {
- var script = JSON.parse(program.ScriptSource);
+ var script = {ConditionType: '', Conditions: [], Commands: []};
+ try { script = JSON.parse(program.ScriptSource); } catch (e) { }
currentProgram.ConditionType = script.ConditionType;
currentProgram.Conditions = script.Conditions;
currentProgram.Commands = script.Commands;
diff --git a/BaseFiles/Common/html/pages/control/widgets/homegenie/generic/energymonitor.js b/BaseFiles/Common/html/pages/control/widgets/homegenie/generic/energymonitor.js
index 2a804743e..15219ee37 100644
--- a/BaseFiles/Common/html/pages/control/widgets/homegenie/generic/energymonitor.js
+++ b/BaseFiles/Common/html/pages/control/widgets/homegenie/generic/energymonitor.js
@@ -123,7 +123,7 @@ function drawStats(mod) {
type: 'GET',
dataType: 'json',
success: function (counterData) {
-
+ if (counterData.History == null) return;
var dataSerie = [];
var yMin = 0;
if (counterData.History.length > 0)