From ba2efec983b61ceb6d5df0a2b537fb0beaf59102 Mon Sep 17 00:00:00 2001 From: Alessandro Vetere Date: Tue, 25 Jun 2019 08:54:16 +0200 Subject: [PATCH] GsDumpFinder: fix error when dir not found --- tools/GSDumpGUI/Forms/Helper/GsDumpFinder.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/GSDumpGUI/Forms/Helper/GsDumpFinder.cs b/tools/GSDumpGUI/Forms/Helper/GsDumpFinder.cs index 1e575750b4..d0e0e6b663 100644 --- a/tools/GSDumpGUI/Forms/Helper/GsDumpFinder.cs +++ b/tools/GSDumpGUI/Forms/Helper/GsDumpFinder.cs @@ -38,7 +38,17 @@ namespace GSDumpGUI.Forms.Helper public IEnumerable 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) {