Skip to content

Commit

Permalink
fix: avoid nil deref when playing without player options override
Browse files Browse the repository at this point in the history
See #77
  • Loading branch information
devgianlu committed Sep 2, 2024
1 parent 5fb116d commit 7ce80cf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/daemon/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,11 @@ func (p *AppPlayer) handlePlayerCommand(req dealer.RequestPayload) error {
p.state.player.Suppressions = req.Command.Options.Suppressions

// apply overrides
p.state.player.Options.ShufflingContext = req.Command.Options.PlayerOptionsOverride.ShufflingContext
p.state.player.Options.RepeatingTrack = req.Command.Options.PlayerOptionsOverride.RepeatingTrack
p.state.player.Options.RepeatingContext = req.Command.Options.PlayerOptionsOverride.RepeatingContext
if req.Command.Options.PlayerOptionsOverride != nil {
p.state.player.Options.ShufflingContext = req.Command.Options.PlayerOptionsOverride.ShufflingContext
p.state.player.Options.RepeatingTrack = req.Command.Options.PlayerOptionsOverride.RepeatingTrack
p.state.player.Options.RepeatingContext = req.Command.Options.PlayerOptionsOverride.RepeatingContext
}

var skipTo skipToFunc
if len(req.Command.Options.SkipTo.TrackUri) > 0 || len(req.Command.Options.SkipTo.TrackUid) > 0 || req.Command.Options.SkipTo.TrackIndex > 0 {
Expand Down

0 comments on commit 7ce80cf

Please sign in to comment.