Handle missing interval in boot notification response.
[e-mobility-charging-stations-simulator.git] / src / charging-station / ChargingStation.ts
index dce900c758c224982e6fa2703c4ac8e1b53c06b3..5bf359b632f9c906923b7304daac47ebfedd28ea 100644 (file)
@@ -661,7 +661,7 @@ export default class ChargingStation {
         this._bootNotificationResponse = await this.sendBootNotification();
         if (!this._isRegistered()) {
           registrationRetryCount++;
-          await Utils.sleep(this._bootNotificationResponse.interval * 1000);
+          await Utils.sleep(this._bootNotificationResponse?.interval ? this._bootNotificationResponse.interval * 1000 : Constants.OCPP_DEFAULT_BOOT_NOTIFICATION_INTERVAL);
         }
       } while (!this._isRegistered() && (registrationRetryCount <= this._getRegistrationMaxRetries() || this._getRegistrationMaxRetries() === -1));
     }