Skip to content

Commit 716bde2

Browse files
chore: add suggestion by copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 77fb742 commit 716bde2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/TibiaKillstatistics.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ func TibiaKillstatisticsImpl(world string, BoxContentHTML string, url string) (K
9393

9494
// Helper function to extract and convert kill statistics
9595
func extractKillStatistics(dataColumns []*html.Node) Entry {
96+
if len(dataColumns) < 5 {
97+
// Not enough columns; return zero-value Entry
98+
return Entry{}
99+
}
96100
return Entry{
97101
Race: TibiaDataSanitizeEscapedString(dataColumns[0].FirstChild.Data),
98102
LastDayKilledPlayers: TibiaDataStringToInteger(dataColumns[1].FirstChild.Data),

0 commit comments

Comments
 (0)