Avoid exception

This commit is contained in:
n00mkrad
2023-02-05 12:40:58 +01:00
parent 850228f9d2
commit c33a14ec9d
2 changed files with 5 additions and 1 deletions

View File

@@ -33,7 +33,8 @@ namespace Flowframes.Forms
{
InterpSettings entry = Program.batchQueue.ElementAt(i);
string outFormat = Strings.OutputFormat.Get(entry.outSettings.Format.ToString());
string str = $"#{i+1}: {Path.GetFileName(entry.inPath).Trunc(40)} - {entry.inFps.GetFloat()} FPS => {entry.interpFactor}x {entry.ai.NameShort} ({entry.model.Name}) => {outFormat}";
string inPath = string.IsNullOrWhiteSpace(entry.inPath) ? "No Path" : Path.GetFileName(entry.inPath).Trunc(40);
string str = $"#{i+1}: {inPath} - {entry.inFps.GetFloat()} FPS => {entry.interpFactor}x {entry.ai.NameShort} ({entry.model.Name}) => {outFormat}";
taskList.Items.Add(str);
}
}

View File

@@ -52,6 +52,9 @@ namespace Flowframes.IO
public static string[] ReadLines(string path)
{
if (!File.Exists(path))
return new string[0];
List<string> lines = new List<string>();
using (var stream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 0x1000, FileOptions.SequentialScan))