summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/release-notes.md1
-rw-r--r--src/SMAPI/Framework/ContentPack.cs2
2 files changed, 2 insertions, 1 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 01bcbad6..a125c92a 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -13,6 +13,7 @@
* For modders:
* Fixed asset propagation for `Data\MoviesReactions`.
+ * Fixed error in the case-insensitive content pack logic when a mod reads a null file path. (It now correctly logs an error in the code that handles the path instead.)
* For the web UI:
* Updated the JSON validator/schema for Content Patcher 1.18.
diff --git a/src/SMAPI/Framework/ContentPack.cs b/src/SMAPI/Framework/ContentPack.cs
index 161fdbe4..a6835dbe 100644
--- a/src/SMAPI/Framework/ContentPack.cs
+++ b/src/SMAPI/Framework/ContentPack.cs
@@ -119,7 +119,7 @@ namespace StardewModdingAPI.Framework
if (!PathUtilities.IsSafeRelativePath(relativePath))
throw new InvalidOperationException($"You must call {nameof(IContentPack)} methods with a relative path.");
- return this.RelativePaths.TryGetValue(relativePath, out string caseInsensitivePath)
+ return !string.IsNullOrWhiteSpace(relativePath) && this.RelativePaths.TryGetValue(relativePath, out string caseInsensitivePath)
? caseInsensitivePath
: relativePath;
}