Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
Ensure OCPI URL is not undefined!
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasBrazi06 committed Aug 4, 2021
1 parent 0aa66cd commit 455868b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client/ocpi/OCPIClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
});
}
Expand Down

0 comments on commit 455868b

Please sign in to comment.