]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
fix: properly handle empty key array in GetConfiguration (#1368)
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 1 Apr 2025 14:51:41 +0000 (16:51 +0200)
committerGitHub <noreply@github.com>
Tue, 1 Apr 2025 14:51:41 +0000 (16:51 +0200)
closes #1364

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
Co-authored-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts

index ec1631589173d9e9a03e3f881c5a3321b89fce87..91b45b13b0a81f3ec4806b4648ad55fee1f3750d 100644 (file)
@@ -1039,7 +1039,7 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService {
     const { key } = commandPayload
     const configurationKey: OCPPConfigurationKey[] = []
     const unknownKey: string[] = []
-    if (key == null) {
+    if (key == null || isEmpty(key)) {
       // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
       for (const configKey of chargingStation.ocppConfiguration!.configurationKey!) {
         if (!OCPP16ServiceUtils.isConfigurationKeyVisible(configKey)) {