|
|
@ -17,9 +17,10 @@ namespace Avalonia.Markup.Xaml.Converters |
|
|
if (s == null) |
|
|
if (s == null) |
|
|
return null; |
|
|
return null; |
|
|
//On Unix Uri tries to interpret paths starting with "/" as file Uris
|
|
|
//On Unix Uri tries to interpret paths starting with "/" as file Uris
|
|
|
if (s.StartsWith("/")) |
|
|
var kind = s.StartsWith("/") ? UriKind.Relative : UriKind.Absolute; |
|
|
return new Uri(s, UriKind.Relative); |
|
|
if (!Uri.TryCreate(s, kind, out var res)) |
|
|
return new Uri(s); |
|
|
throw new ArgumentException("Unable to parse URI: " + s); |
|
|
|
|
|
return res; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|