From 9cebe21dd233da2324857e86a093821f10280708 Mon Sep 17 00:00:00 2001 From: andig Date: Tue, 29 Sep 2020 11:29:26 +0200 Subject: [PATCH] Fix panic when accessing socEstimator without car configured --- core/loadpoint.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/loadpoint.go b/core/loadpoint.go index 161d1eb4d..d2a145db4 100644 --- a/core/loadpoint.go +++ b/core/loadpoint.go @@ -287,7 +287,9 @@ func (lp *LoadPoint) evVehicleConnectHandler() { lp.publish("connectedDuration", 0) // soc estimation reset on car change - lp.socEstimator.Reset() + if lp.socEstimator != nil { + lp.socEstimator.Reset() + } lp.notify(evVehicleConnect) }