From bc76d84b847c9d4a4f587df63c4150ae73946d81 Mon Sep 17 00:00:00 2001 From: Kai Hermann Date: Thu, 22 Aug 2024 10:29:38 +0200 Subject: [PATCH] Fix EvManager crash if not iso 15118 car was connected (#839) Signed-off-by: Kai-Uwe Hermann --- modules/EvManager/main/car_simulation.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/EvManager/main/car_simulation.cpp b/modules/EvManager/main/car_simulation.cpp index 85da5ee75..79c041e92 100644 --- a/modules/EvManager/main/car_simulation.cpp +++ b/modules/EvManager/main/car_simulation.cpp @@ -21,7 +21,9 @@ void CarSimulation::state_machine() { // Wait for physical plugin (ev BSP sees state A on CP and not Disconnected) sim_data.slac_state = "UNMATCHED"; - r_ev[0]->call_stop_charging(); + if (!r_ev.empty()) { + r_ev[0]->call_stop_charging(); + } } break; case SimState::PLUGGED_IN: