Fix invalid array access

This commit is contained in:
andig 2020-08-27 17:11:37 +02:00
parent e9d673f59f
commit 8e1eaf1eef

View file

@ -57,14 +57,13 @@ func NewConfigurableFromConfig(other map[string]interface{}) (api.Meter, error)
return nil, errors.New("need 3 currents")
}
var currentsG []func() (float64, error)
for _, cc := range cc.Currents {
c, err := provider.NewFloatGetterFromConfig(cc)
if err != nil {
return nil, err
}
m.currentsG = append(currentsG, c)
m.currentsG = append(m.currentsG, c)
}
currents = m.currents