Add safety check around empty config files

This commit is contained in:
Matt Nadareski
2024-12-06 23:58:21 -05:00
parent b8e923207f
commit 2bb854e7a5
2 changed files with 2 additions and 1 deletions

View File

@@ -62,6 +62,7 @@
- Update README to remove AppVeyor references
- Remove unused gated using statement
- Add alternate config location
- Add safety check around empty config files
### 3.2.4 (2024-11-24)

View File

@@ -298,7 +298,7 @@ namespace MPF.Frontend.Tools
return new Options();
// Ensure the file exists
if (!File.Exists(ConfigurationPath))
if (!File.Exists(ConfigurationPath) || new FileInfo(ConfigurationPath).Length == 0)
{
File.Create(ConfigurationPath).Dispose();
return new Options();