file exists

This commit is contained in:
Pilzinsel64
2025-07-31 09:13:48 +02:00
parent f4530aee4f
commit c6ef91fde7

View File

@@ -7,11 +7,14 @@ public class JsonFileContainer(string filePath) : JsonDataContainer
public override void Read() public override void Read()
{ {
lock (_lock_FileAction) lock (_lock_FileAction)
{
if (File.Exists(filePath))
{ {
using var sw = new StreamReader(filePath); using var sw = new StreamReader(filePath);
GetSerializer().Populate(sw, this); GetSerializer().Populate(sw, this);
} }
} }
}
public override void Flush() public override void Flush()
{ {