this.wsConnection = new WebSocket(
this.wsConnectionUrl,
- `ocpp${this.stationInfo.ocppVersion}`,
+ `ocpp${this.stationInfo?.ocppVersion}`,
options,
);
}
private initializeOcppServices(): void {
- const ocppVersion = this.stationInfo.ocppVersion;
+ const ocppVersion = this.stationInfo?.ocppVersion;
switch (ocppVersion) {
case OCPPVersion.VERSION_16:
this.ocppIncomingRequestService =
} while (
this.isRegistered() === false &&
(registrationRetryCount <= this.stationInfo.registrationMaxRetries! ||
- this.stationInfo?.registrationMaxRetries) === -1
+ this.stationInfo?.registrationMaxRetries === -1)
);
}
if (this.isRegistered() === true) {
private async handleIncomingMessage(request: IncomingRequest): Promise<void> {
const [messageType, messageId, commandName, commandPayload] = request;
- if (this.stationInfo.enableStatistics === true) {
+ if (this.stationInfo?.enableStatistics === true) {
this.performanceStatistics?.addRequestStatistic(commandName, messageType);
}
logger.debug(