From b4163d47602efc66eddda551ebad058a5a38046c Mon Sep 17 00:00:00 2001
From: lindsaynnw <142308463+lindsaynnw@users.noreply.github.com>
Date: Tue, 28 Apr 2026 01:21:36 -0500
Subject: [PATCH] Fix #1009: use Directory.CreateDirectory for path creation
---
src/SMAPI/Framework/SCore.cs | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs
index eceda4d03..46ab46c49 100644
--- a/src/SMAPI/Framework/SCore.cs
+++ b/src/SMAPI/Framework/SCore.cs
@@ -1944,18 +1944,17 @@ public void LogContentIntegrityIssues()
/// Create a directory path if it doesn't exist.
/// The directory path.
private void VerifyPath(string path)
+{
+ try
{
- try
- {
- if (!Directory.Exists(path))
- Directory.CreateDirectory(path);
- }
- catch (Exception ex)
- {
- // note: this happens before this.Monitor is initialized
- Console.WriteLine($"Couldn't create a path: {path}\n\n{ex.GetLogSummary()}");
- }
+ Directory.CreateDirectory(path);
}
+ catch (Exception ex)
+ {
+ // note: this happens before this.Monitor is initialized
+ Console.WriteLine($"Couldn't create a path: {path}\n\n{ex.GetLogSummary()}");
+ }
+}
/// Load and hook up the given mods.
/// The mods to load.