summaryrefslogtreecommitdiff
path: root/src/SMAPI
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-02-19 20:18:53 -0500
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-02-19 20:18:53 -0500
commitc38c2b2c41b97ae7f7e46a4010107221a0e47c91 (patch)
treef155bf6efb955c42bdd1d14198632c521ca17a38 /src/SMAPI
parent3b4e81bf69e28c9bcc33c782f58e5099d73c4f91 (diff)
downloadSMAPI-c38c2b2c41b97ae7f7e46a4010107221a0e47c91.tar.gz
SMAPI-c38c2b2c41b97ae7f7e46a4010107221a0e47c91.tar.bz2
SMAPI-c38c2b2c41b97ae7f7e46a4010107221a0e47c91.zip
fix edge case in relative path logic
Diffstat (limited to 'src/SMAPI')
-rw-r--r--src/SMAPI/Framework/Utilities/PathUtilities.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/SMAPI/Framework/Utilities/PathUtilities.cs b/src/SMAPI/Framework/Utilities/PathUtilities.cs
index 4fa521f1..0233d796 100644
--- a/src/SMAPI/Framework/Utilities/PathUtilities.cs
+++ b/src/SMAPI/Framework/Utilities/PathUtilities.cs
@@ -53,7 +53,10 @@ namespace StardewModdingAPI.Framework.Utilities
throw new InvalidOperationException($"Can't get path for '{targetPath}' relative to '{sourceDir}'.");
// get relative path
- return PathUtilities.NormalisePathSeparators(Uri.UnescapeDataString(from.MakeRelativeUri(to).ToString()));
+ string relative = PathUtilities.NormalisePathSeparators(Uri.UnescapeDataString(from.MakeRelativeUri(to).ToString()));
+ if (relative == "")
+ relative = "./";
+ return relative;
}
}
}