diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-09-24 19:41:36 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-09-24 19:41:36 -0400 |
commit | 4eff88fe73760ef89423de76cae80ffeee235240 (patch) | |
tree | b4cf81eda49be01a8ab148ae81861e563afc01fd | |
parent | 9edd3b901a110ef1fddcbcc05730da1b1cadd680 (diff) | |
download | SMAPI-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.md | 1 | ||||
-rw-r--r-- | src/SMAPI/Framework/ContentPack.cs | 2 |
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; } |