From de7134df4840c3df7d1774fc87cbd2e9ce60de80 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 19 Sep 2018 14:45:27 +0200 Subject: [PATCH] BUG Fixed, When Status Report does not exist --- Context.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Context.js b/Context.js index 1056fa75e..c834d8d1a 100644 --- a/Context.js +++ b/Context.js @@ -153,7 +153,9 @@ statusReportModule = statusDependencies.statusReports.get(key); thisObject.statusReport = statusReportModule.file; - if (bot.hasTheBotJustStarted === true) { + /* The context is created in 2 situations: 1) when at the bot config is set not to continue using the same context after a new execution. 2) when the status report does not exist. */ + + if (bot.hasTheBotJustStarted === true || thisObject.statusReport.runs === undefined) { createConext(callBack); @@ -167,6 +169,7 @@ } catch (err) { logger.write(MODULE_NAME, "[ERROR] initialize -> getStatusReport -> err = " + err.message); + logger.write(MODULE_NAME, "[ERROR] initialize -> getStatusReport -> key = " + key); callBack(global.DEFAULT_FAIL_RESPONSE); } }