Skip to content

Commit

Permalink
fix: NPE when game has "Disc" in name (#535)
Browse files Browse the repository at this point in the history
  • Loading branch information
igorcafe authored Mar 9, 2024
1 parent 5c12453 commit f83948d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions menu/scene_playlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 23,11 @@ func buildPlaylist(path string) Scene {
var list scenePlaylist
list.label = utils.FileName(path)

re := regexp.MustCompile(`\(([Dd]isc [1-9]?)\)`)
for _, game := range playlists.Playlists[path] {
game := game // needed for callbackOK
strippedName, tags := extractTags(game.Name)
if strings.Contains(game.Name, "Disc") {
re := regexp.MustCompile(`\((Disc [1-9]?)\)`)
match := re.FindStringSubmatch(game.Name)
if match := re.FindStringSubmatch(game.Name); len(match) >= 2 {
strippedName = strippedName " (" match[1] ")"
}
list.children = append(list.children, entry{
Expand Down

0 comments on commit f83948d

Please sign in to comment.