summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-09-24 19:41:36 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-09-24 19:41:36 -0400
commit4eff88fe73760ef89423de76cae80ffeee235240 (patch)
treeb4cf81eda49be01a8ab148ae81861e563afc01fd
parent9edd3b901a110ef1fddcbcc05730da1b1cadd680 (diff)
downloadSMAPI-4eff88fe73760ef89423de76cae80ffeee235240.tar.gz
SMAPI-4eff88fe73760ef89423de76cae80ffeee235240.tar.bz2
SMAPI-4eff88fe73760ef89423de76cae80ffeee235240.zip
fix error in case-insensitive content pack code when mod passes in a null path
-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;
}