diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-02-19 20:18:53 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-02-19 20:18:53 -0500 |
commit | c38c2b2c41b97ae7f7e46a4010107221a0e47c91 (patch) | |
tree | f155bf6efb955c42bdd1d14198632c521ca17a38 /src/SMAPI | |
parent | 3b4e81bf69e28c9bcc33c782f58e5099d73c4f91 (diff) | |
download | SMAPI-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.cs | 5 |
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; } } } |