Skip to content

Commit

Permalink
Add safety check around empty config files
Browse files Browse the repository at this point in the history
  • Loading branch information
mnadareski committed Dec 7, 2024
1 parent b8e9232 commit 2bb854e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion MPF.Frontend/Tools/OptionsLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public static Options LoadFromConfig()
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();
Expand Down

0 comments on commit 2bb854e

Please sign in to comment.