diff --git a/src/Files.App/Helpers/PathNormalization.cs b/src/Files.App/Helpers/PathNormalization.cs index f87805ec9852..c91c1ab6d1e3 100644 --- a/src/Files.App/Helpers/PathNormalization.cs +++ b/src/Files.App/Helpers/PathNormalization.cs @@ -44,11 +44,15 @@ public static string NormalizePath(string path) try { - return Path.GetFullPath(new Uri(path).LocalPath) + var pathUri = new Uri(path).LocalPath; + if (string.IsNullOrEmpty(pathUri)) + return path; + + return Path.GetFullPath(pathUri) .TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar) .ToUpperInvariant(); } - catch (UriFormatException ex) + catch (Exception ex) when (ex is UriFormatException || ex is ArgumentException) { App.Logger.LogWarning(ex, path); return path;