mirror of
https://github.com/libretro/Mesen.git
synced 2024-11-27 02:50:28 +00:00
Fixed crash when trying to load random roms when folder no longer exists
This commit is contained in:
parent
d968541444
commit
535a2e45f0
@ -1620,9 +1620,11 @@ namespace Mesen.GUI.Forms
|
||||
List<string> gameRoms = new List<string>();
|
||||
|
||||
foreach(string folder in gameFolders) {
|
||||
gameRoms.AddRange(Directory.EnumerateFiles(folder, "*.nes", SearchOption.TopDirectoryOnly));
|
||||
gameRoms.AddRange(Directory.EnumerateFiles(folder, "*.unf", SearchOption.TopDirectoryOnly));
|
||||
gameRoms.AddRange(Directory.EnumerateFiles(folder, "*.fds", SearchOption.TopDirectoryOnly));
|
||||
if(Directory.Exists(folder)) {
|
||||
gameRoms.AddRange(Directory.EnumerateFiles(folder, "*.nes", SearchOption.TopDirectoryOnly));
|
||||
gameRoms.AddRange(Directory.EnumerateFiles(folder, "*.unf", SearchOption.TopDirectoryOnly));
|
||||
gameRoms.AddRange(Directory.EnumerateFiles(folder, "*.fds", SearchOption.TopDirectoryOnly));
|
||||
}
|
||||
}
|
||||
|
||||
if(gameRoms.Count == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user