GsDumpFinder: fix error when dir not found

This commit is contained in:
Alessandro Vetere 2019-06-25 08:54:16 +02:00 committed by Akash
parent b19804190e
commit ba2efec983
1 changed files with 11 additions and 1 deletions

View File

@ -38,7 +38,17 @@ namespace GSDumpGUI.Forms.Helper
public IEnumerable<GsDumpFile> GetValidGsdxDumps(DirectoryInfo directory)
{
var dumps = directory.GetFiles("*.gs", SearchOption.TopDirectoryOnly);
var dumps = new FileInfo[0];
try
{
dumps = directory.GetFiles("*.gs", SearchOption.TopDirectoryOnly);
}
catch (DirectoryNotFoundException)
{
_logger.Warning($"Failed to open folder '{directory}'.");
yield break;
}
foreach (var dump in dumps)
{