Fix panic when accessing socEstimator without car configured
This commit is contained in:
parent
bad8276aae
commit
9cebe21dd2
1 changed files with 3 additions and 1 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue