repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Falsy/truthy test fixes
[e-mobility-charging-stations-simulator.git]
/
src
/
charging-station
/
ocpp
/
OCPPRequestService.ts
diff --git
a/src/charging-station/ocpp/OCPPRequestService.ts
b/src/charging-station/ocpp/OCPPRequestService.ts
index fc4410f8658653b16e5305b8251441fe0577ae55..6a7729950de33b2532fb1b8c0153dc170280a957 100644
(file)
--- a/
src/charging-station/ocpp/OCPPRequestService.ts
+++ b/
src/charging-station/ocpp/OCPPRequestService.ts
@@
-68,7
+68,7
@@
export default abstract class OCPPRequestService {
messageId: string,
messagePayload: JsonType,
commandName: IncomingRequestCommand
messageId: string,
messagePayload: JsonType,
commandName: IncomingRequestCommand
- ): Promise<ResponseType
| undefined
> {
+ ): Promise<ResponseType> {
try {
// Send response message
return await this.internalSendMessage(
try {
// Send response message
return await this.internalSendMessage(
@@
-232,7
+232,7
@@
export default abstract class OCPPRequestService {
return Utils.promiseWithTimeout(
new Promise((resolve, reject) => {
if (chargingStation.getEnableStatistics() === true) {
return Utils.promiseWithTimeout(
new Promise((resolve, reject) => {
if (chargingStation.getEnableStatistics() === true) {
- chargingStation.performanceStatistics.addRequestStatistic(commandName, messageType);
+ chargingStation.performanceStatistics
?
.addRequestStatistic(commandName, messageType);
}
const messageToSend = this.buildMessageToSend(
chargingStation,
}
const messageToSend = this.buildMessageToSend(
chargingStation,
@@
-306,7
+306,7
@@
export default abstract class OCPPRequestService {
*/
function responseCallback(payload: JsonType, requestPayload: JsonType): void {
if (chargingStation.getEnableStatistics() === true) {
*/
function responseCallback(payload: JsonType, requestPayload: JsonType): void {
if (chargingStation.getEnableStatistics() === true) {
- chargingStation.performanceStatistics.addRequestStatistic(
+ chargingStation.performanceStatistics
?
.addRequestStatistic(
commandName,
MessageType.CALL_RESULT_MESSAGE
);
commandName,
MessageType.CALL_RESULT_MESSAGE
);
@@
-338,7
+338,7
@@
export default abstract class OCPPRequestService {
*/
function errorCallback(error: OCPPError, requestStatistic = true): void {
if (requestStatistic === true && chargingStation.getEnableStatistics() === true) {
*/
function errorCallback(error: OCPPError, requestStatistic = true): void {
if (requestStatistic === true && chargingStation.getEnableStatistics() === true) {
- chargingStation.performanceStatistics.addRequestStatistic(
+ chargingStation.performanceStatistics
?
.addRequestStatistic(
commandName,
MessageType.CALL_ERROR_MESSAGE
);
commandName,
MessageType.CALL_ERROR_MESSAGE
);