GO-E: fix panic on invalid RFID index (#25226)

This commit is contained in:
RenatusRo 2025-11-11 10:41:56 +01:00 • committed by GitHub
parent b928514dd8
commit b4cfa95926
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -65,7 +65,7 @@ func (g *StatusResponse2) Voltages() (float64, float64, float64) {
}
func (g *StatusResponse2) Identify() string {
if g.Trx > 0 {
if g.Trx > 0 && len(g.Cards) >= g.Trx {
return g.Cards[g.Trx-1].Name
}