diff --git a/main.go b/main.go index 5e9c172..b37542e 100644 --- a/main.go +++ b/main.go @@ -624,7 +624,12 @@ func getMatchChat(c *gin.Context) { c.Status(http.StatusBadRequest) return } - lang, _ := tag[0].Base() + var lang string + if len(tag) > 0 { + lang, _ = tag[0].Base() + } else { + lang = "en" + } log.Debugf("[GMC] Got header %s, selected %s from %v (w: %v)", c.GetHeader("Accept-Language"), lang, tag, weights) var translate bool