From: Jérôme Benoit Date: Tue, 20 Oct 2020 21:41:36 +0000 (+0200) Subject: Remove useless empty check and init on variable. X-Git-Tag: v1.0.1-0~256 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=52f96caff66d8b26f18d587d59e4fb861acf621c;p=e-mobility-charging-stations-simulator.git Remove useless empty check and init on variable. Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.js b/src/charging-station/ChargingStation.js index c6b3a5ae..a37c3a45 100644 --- a/src/charging-station/ChargingStation.js +++ b/src/charging-station/ChargingStation.js @@ -626,7 +626,7 @@ class ChargingStation { // Error Message case Constants.OCPP_JSON_CALL_ERROR_MESSAGE: // Build Message - this._statistics.addMessage(`Error ${command.code ? command.code : Constants.OCPP_ERROR_GENERIC_ERROR} on ${commandName || ''}`); + this._statistics.addMessage(`Error ${command.code ? command.code : Constants.OCPP_ERROR_GENERIC_ERROR} on ${commandName}`); messageToSend = JSON.stringify([messageType, messageId, command.code ? command.code : Constants.OCPP_ERROR_GENERIC_ERROR, command.message ? command.message : '', command.details ? command.details : {}]); break; } @@ -663,7 +663,7 @@ class ChargingStation { // Function that will receive the request's rejection function rejectCallback(reason) { - self._statistics.addMessage(`Error ${command.code ? command.code : Constants.OCPP_ERROR_GENERIC_ERROR} on ${commandName || ''}`, true); + self._statistics.addMessage(`Error ${command.code ? command.code : Constants.OCPP_ERROR_GENERIC_ERROR} on ${commandName}`, true); // Build Exception // eslint-disable-next-line no-empty-function self._requests[messageId] = [() => { }, () => { }, '']; // Properly format the request