Avoid OICP NPE when charging station is not found
MODIFY
src/server/oicp/OICPUtils.ts
src/server/oicp/OICPUtils.ts
@@ -130,11 +130,13 @@ export default class OICPUtils {
const evseIDComponents = RoamingUtils.getEvseIdComponents(evseID);
const chargingStation = await ChargingStationStorage.getChargingStationByOicpEvseID(tenant.id, evseID);
let foundConnector: Connector;
+ if (chargingStation) {
for (const connector of chargingStation.connectors) {
if (evseID === RoamingUtils.buildEvseID(evseIDComponents.countryCode, evseIDComponents.partyId, chargingStation.id, connector.connectorId)) {
foundConnector = connector;
}
}
+ }
return {
chargingStation: chargingStation,
connector: foundConnector

Avoid OICP NPE when charging station is not found