Avoid unnecessary exceptions

This commit is contained in:
n00mkrad
2023-01-31 11:45:12 +01:00
parent e314ad8639
commit 9bfb909c09
2 changed files with 4 additions and 1 deletions

View File

@@ -601,7 +601,7 @@ namespace Flowframes
Logger.Log("Selected video/directory: " + Path.GetFileName(files[0]), true);
inputTbox.Text = files[0];
bool resume = (IoUtils.GetAmountOfFiles(Path.Combine(files[0], Paths.resumeDir), true, "*.json") > 0);
bool resume = Directory.Exists(files[0]) && IoUtils.GetAmountOfFiles(Path.Combine(files[0], Paths.resumeDir), true, "*.json") > 0;
AutoEncodeResume.resumeNextRun = resume;
if (resume)

View File

@@ -206,6 +206,9 @@ namespace Flowframes.IO
{
try
{
if (!Directory.Exists(path))
return 0;
DirectoryInfo d = new DirectoryInfo(path);
FileInfo[] files = null;