From 455868b3fe8d24dfa98e4ca13d5e4c14d87028b2 Mon Sep 17 00:00:00 2001 From: LucasBrazi06 Date: Wed, 4 Aug 2021 17:21:19 +0200 Subject: [PATCH] Ensure OCPI URL is not undefined! --- src/client/ocpi/OCPIClient.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/ocpi/OCPIClient.ts b/src/client/ocpi/OCPIClient.ts index 1ff3a355ec..3f55648e52 100644 --- a/src/client/ocpi/OCPIClient.ts +++ b/src/client/ocpi/OCPIClient.ts @@ -225,11 +225,11 @@ export default abstract class OCPIClient { } protected getEndpointUrl(service: string, action: ServerAction): string { - if (this.ocpiEndpoint.availableEndpoints) { + if (this.ocpiEndpoint.availableEndpoints && this.ocpiEndpoint.availableEndpoints[service]) { return this.ocpiEndpoint.availableEndpoints[service]; } throw new BackendError({ - action, message: `No endpoint URL defined for service ${service}`, + action, message: `No endpoint URL defined for service '${service}'`, module: MODULE_NAME, method: 'getEndpointUrl', }); }