forked from security/hakurei
internal/pipewire: return correct size for nil spa_dict
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.
|
||||
func (d *SPADict) Size() Word {
|
||||
if d == nil {
|
||||
return 0
|
||||
if *d == nil {
|
||||
// None type prefix with zero-length body
|
||||
return SizePrefix
|
||||
}
|
||||
|
||||
// struct prefix, NItems value
|
||||
|
||||
Reference in New Issue
Block a user