Open ius opened 1 month ago
Media
is only written upon initialization of the object and is surely non-nil at that time. I think secondaryStream
became nil because prefetchNext
runs in a goroutine and shouldn't access that stuff directly as the goroutine that handles command may be changing stuff (for example in loadCurrentTrack
).
It is not trivial to fix, but hopefully shouldn't happen very often.
Not entirely sure how I triggered it, but there's a nil pointer dereference path in:
https://github.com/devgianlu/go-librespot/blob/b98dad6c894b94ee71d30d7ed54f2955ee7f53c4/cmd/daemon/controls.go#L40-L42
I suppose
p.secondaryStream.Media
is nil here?