diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-11-25 18:36:08 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-11-25 18:36:08 +0900 |
| commit | 14e33f17e52f27997380bdf87d12bf5d8121c586 (patch) | |
| tree | 952efa3819b6b8ec765f094387d88b4c293ba713 | |
| parent | cfeb7818eb3d7f3e83492bab092adce8f90f83c1 (diff) | |
internal/pipewire: check nil marshaler
NULL values have special case in the format. This check ensures correctness serialising nil pointers.
Signed-off-by: Ophestra <cat@gensokyo.uk>
| -rw-r--r-- | internal/pipewire/pod.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/pipewire/pod.go b/internal/pipewire/pod.go index 811a77ae..1c02bd95 100644 --- a/internal/pipewire/pod.go +++ b/internal/pipewire/pod.go @@ -120,7 +120,7 @@ func appendInner(data []byte, f func(data []byte) ([]byte, error)) ([]byte, erro // marshalValueAppendRaw implements [MarshalAppend] on [reflect.Value]. func marshalValueAppend(data []byte, v reflect.Value) ([]byte, error) { - if v.CanInterface() { + if v.CanInterface() && (v.Kind() != reflect.Pointer || !v.IsNil()) { if m, ok := v.Interface().(PODMarshaler); ok { extraData, err := m.MarshalPOD() return append(data, extraData...), err |
