diff --git a/util/tee.go b/util/tee.go index eb8670f45..69318c71a 100644 --- a/util/tee.go +++ b/util/tee.go @@ -1,5 +1,7 @@ package util +import "reflect" + // TeeAttacher allows to attach a listener to a tee type TeeAttacher interface { Attach() <-chan Param @@ -28,6 +30,13 @@ func (t *Tee) add(out chan<- Param) { func (t *Tee) Run(in <-chan Param) { for msg := range in { for _, recv := range t.recv { + // dereference pointers (https://github.com/evcc-io/evcc/issues/7895) + if val := reflect.ValueOf(msg.Val); val.Kind() == reflect.Ptr { + if ptr := reflect.Indirect(val); ptr.IsValid() { + msg.Val = ptr.Addr().Elem().Interface() + } + } + recv <- msg } }