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)
|
if (Settings.MonoFileIO)
|
||||||
{
|
{
|
||||||
System.IO.FileInfo fi = new System.IO.FileInfo(path);
|
System.IO.FileInfo fi = new System.IO.FileInfo(path);
|
||||||
|
|
||||||
|
if(!fi.Exists) return;
|
||||||
|
|
||||||
Length = fi.Length;
|
Length = fi.Length;
|
||||||
LastWriteTime = fi.LastWriteTimeUtc.Ticks;
|
LastWriteTime = fi.LastWriteTimeUtc.Ticks;
|
||||||
return;
|
return;
|
||||||
@@ -94,6 +97,9 @@ namespace ROMVault2.IO
|
|||||||
if (Settings.MonoFileIO)
|
if (Settings.MonoFileIO)
|
||||||
{
|
{
|
||||||
System.IO.DirectoryInfo fi = new System.IO.DirectoryInfo(path);
|
System.IO.DirectoryInfo fi = new System.IO.DirectoryInfo(path);
|
||||||
|
|
||||||
|
if(!fi.Exists) return;
|
||||||
|
|
||||||
LastWriteTime = fi.LastWriteTimeUtc.Ticks;
|
LastWriteTime = fi.LastWriteTimeUtc.Ticks;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user