File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -268,13 +268,17 @@ func TibiaCharactersCharacterV3Impl(BoxContentHTML string) CharacterResponse {
268268 // Removing line breaks
269269 CharacterListHTML = TibiadataHTMLRemoveLinebreaksV3 (CharacterListHTML )
270270
271- subma1 := accountBadgesRegex .FindAllStringSubmatch (CharacterListHTML , - 1 )
271+ // prevent failure of regex that parses account badges
272+ if CharacterListHTML != "There are no account badges set to be displayed for this character." {
272273
273- AccountBadgesData = append (AccountBadgesData , AccountBadges {
274- Name : subma1 [0 ][1 ],
275- IconURL : subma1 [0 ][3 ],
276- Description : subma1 [0 ][2 ],
277- })
274+ subma1 := accountBadgesRegex .FindAllStringSubmatch (CharacterListHTML , - 1 )
275+
276+ AccountBadgesData = append (AccountBadgesData , AccountBadges {
277+ Name : subma1 [0 ][1 ],
278+ IconURL : subma1 [0 ][3 ],
279+ Description : subma1 [0 ][2 ],
280+ })
281+ }
278282 })
279283 case "Account Achievements" :
280284 // Running query over each tr in list
You can’t perform that action at this time.
0 commit comments