Skip to content

🎧 Your Personal Streaming Service

fix(server): panic when logging tag type. Fix #3790

Deluan5c67297dcef6
diff --git a/model/tag_mappings.go b/model/tag_mappings.go
index 3215feb35..b0cf85fae 100644
--- a/model/tag_mappings.go
+++ b/model/tag_mappings.go
@@ -55,6 +55,7 @@ func (c TagConf) SplitTagValue(values []string) []string {
type TagType string
const (
+ TagTypeString TagType = "string"
TagTypeInteger TagType = "int"
TagTypeFloat TagType = "float"
TagTypeDate TagType = "date"
@@ -113,8 +114,9 @@ func collectTags(tagMappings, normalized map[TagName]TagConf) {
aliases = append(aliases, strings.ToLower(val))
}
if v.Split != nil {
- if v.Type != "" {
- log.Error("Tag splitting only available for string types", "tag", k, "split", v.Split, "type", v.Type)
+ if v.Type != "" && v.Type != TagTypeString {
+ log.Error("Tag splitting only available for string types", "tag", k, "split", v.Split,
+ "type", string(v.Type))
v.Split = nil
} else {
v.SplitRx = compileSplitRegex(k, v.Split)