Don't attempt to read Length/LastWriteTimeUtc if the file/dir doesn't exist
This commit is contained in:
@@ -60,6 +60,9 @@ namespace ROMVault2.IO
|
||||
if (Settings.MonoFileIO)
|
||||
{
|
||||
System.IO.FileInfo fi = new System.IO.FileInfo(path);
|
||||
|
||||
if(!fi.Exists) return;
|
||||
|
||||
Length = fi.Length;
|
||||
LastWriteTime = fi.LastWriteTimeUtc.Ticks;
|
||||
return;
|
||||
@@ -94,6 +97,9 @@ namespace ROMVault2.IO
|
||||
if (Settings.MonoFileIO)
|
||||
{
|
||||
System.IO.DirectoryInfo fi = new System.IO.DirectoryInfo(path);
|
||||
|
||||
if(!fi.Exists) return;
|
||||
|
||||
LastWriteTime = fi.LastWriteTimeUtc.Ticks;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user