From a8f585bff8f1269ebf2db5129b45b7448eb934f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Mileusni=C4=87?= Date: Fri, 14 Apr 2023 17:16:36 +0200 Subject: [PATCH] Bug-fix out of range --- ua.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ua.go b/ua.go index 430fd88..accbe9e 100644 --- a/ua.go +++ b/ua.go @@ -579,7 +579,7 @@ func findVersion(s string) string { // findAndroidDevice in tokens func (p *properties) findAndroidDevice(startIndex int) string { for i := startIndex; i < startIndex+1; i++ { - if len(p.list) > i { + if len(p.list) > i+1 { dev := p.list[i+1].Key if len(dev) == 2 || (len(dev) == 5 && dev[2] == '-') { // probably langage tag (en-us etc..), ignore and continue loop