Skip to content

Commit

Permalink
Fix nil pointer dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed May 25, 2020
1 parent 72cb385 commit 72e92c7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion engine/scrobbler.go
Expand Up @@ -43,7 +43,11 @@ func (s *scrobbler) Register(ctx context.Context, playerId int, trackId string,
return err
})

log.Info("Scrobbled", "title", mf.Title, "artist", mf.Artist, "user", userName(ctx))
if err != nil {
log.Error("Error while scrobbling", "trackId", trackId, err)
} else {
log.Info("Scrobbled", "title", mf.Title, "artist", mf.Artist, "user", userName(ctx))
}

return mf, err
}
Expand Down

0 comments on commit 72e92c7

Please sign in to comment.