internal/pipewire: return correct size for nil spa_dict
All checks were successful
Test / Create distribution (push) Successful in 34s
Test / Sandbox (push) Successful in 2m30s
Test / Hakurei (push) Successful in 3m30s
Test / Hpkg (push) Successful in 4m15s
Test / Sandbox (race detector) (push) Successful in 4m22s
Test / Hakurei (race detector) (push) Successful in 5m25s
Test / Flake checks (push) Successful in 1m39s
All checks were successful
Test / Create distribution (push) Successful in 34s
Test / Sandbox (push) Successful in 2m30s
Test / Hakurei (push) Successful in 3m30s
Test / Hpkg (push) Successful in 4m15s
Test / Sandbox (race detector) (push) Successful in 4m22s
Test / Hakurei (race detector) (push) Successful in 5m25s
Test / Flake checks (push) Successful in 1m39s
A nil spa_dict results in a None type value being sent over the wire. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -504,8 +504,9 @@ type SPADict []SPADictItem
|
|||||||
|
|
||||||
// Size satisfies [KnownSize] with a value computed at runtime.
|
// Size satisfies [KnownSize] with a value computed at runtime.
|
||||||
func (d *SPADict) Size() Word {
|
func (d *SPADict) Size() Word {
|
||||||
if d == nil {
|
if *d == nil {
|
||||||
return 0
|
// None type prefix with zero-length body
|
||||||
|
return SizePrefix
|
||||||
}
|
}
|
||||||
|
|
||||||
// struct prefix, NItems value
|
// struct prefix, NItems value
|
||||||
|
|||||||
Reference in New Issue
Block a user