internal/pipewire: spa_dict size nil check
All checks were successful
Test / Create distribution (push) Successful in 36s
Test / Sandbox (push) Successful in 2m21s
Test / Hakurei (push) Successful in 3m14s
Test / Hpkg (push) Successful in 4m7s
Test / Sandbox (race detector) (push) Successful in 4m26s
Test / Hakurei (race detector) (push) Successful in 5m9s
Test / Flake checks (push) Successful in 1m24s
All checks were successful
Test / Create distribution (push) Successful in 36s
Test / Sandbox (push) Successful in 2m21s
Test / Hakurei (push) Successful in 3m14s
Test / Hpkg (push) Successful in 4m7s
Test / Sandbox (race detector) (push) Successful in 4m26s
Test / Hakurei (race detector) (push) Successful in 5m9s
Test / Flake checks (push) Successful in 1m24s
This fixes serialisation of NULL spa_dict. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
dcb22a61c0
commit
91efeb101a
@ -467,6 +467,10 @@ type SPADict struct {
|
|||||||
|
|
||||||
// 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 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
// struct prefix, NItems value
|
// struct prefix, NItems value
|
||||||
size := SizePrefix + int(Size(SizeInt))
|
size := SizePrefix + int(Size(SizeInt))
|
||||||
for i := range d.Items {
|
for i := range d.Items {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user