Fix panic when accessing socEstimator without car configured

This commit is contained in:
andig 2020-09-29 11:29:26 +02:00
parent bad8276aae
commit 9cebe21dd2

View file

@ -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)
}