Skip to content

Commit

Permalink
fix: scoreboard assist panic
Browse files Browse the repository at this point in the history
  • Loading branch information
redraskal committed Feb 23, 2024
1 parent 415178e commit 73de45f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dissect/scoreboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ func readScoreboardAssists(r *Reader) error {
return err
}
idx := r.PlayerIndexByID(id)
username := r.Header.Players[idx].Username
r.Scoreboard.Players[idx].Assists = assists
username := "N/A"
if idx != -1 {
username = r.Header.Players[idx].Username
r.Scoreboard.Players[idx].Assists = assists
}
log.Debug().
Uint32("assists", assists).
Str("username", username).
Expand Down

0 comments on commit 73de45f

Please sign in to comment.