From 73de45fc9148d6aa159805f6f4a48a6da5bd21e4 Mon Sep 17 00:00:00 2001 From: redraskal Date: Thu, 22 Feb 2024 18:59:21 -0600 Subject: [PATCH] fix: scoreboard assist panic --- dissect/scoreboard.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dissect/scoreboard.go b/dissect/scoreboard.go index 5d62035..cc41a5c 100644 --- a/dissect/scoreboard.go +++ b/dissect/scoreboard.go @@ -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).