Path extensions - address nullability in a few places

This commit is contained in:
adelikat 2020-03-15 15:47:12 -05:00
parent 33a14327b7
commit 9fa4bac8d4
1 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ namespace BizHawk.Common.PathExtensions
/// <summary>
/// Decides if a path is non-empty, not . and not .\
/// </summary>
public static bool PathIsSet(this string path)
public static bool PathIsSet(this string? path)
{
return !string.IsNullOrWhiteSpace(path) && path != "." && path != ".\\";
}
@ -47,7 +47,7 @@ namespace BizHawk.Common.PathExtensions
}
var parentUri = new Uri(parentPath);
for (var childUri = new DirectoryInfo(childPath).Parent; childUri != null; childUri = childUri?.Parent)
for (var childUri = new DirectoryInfo(childPath).Parent; childUri != null; childUri = childUri.Parent)
{
if (new Uri(childUri.FullName) == parentUri) return true;
}