From d69116b4756211594e83f2fbdb384c34dcc1c630 Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Fri, 16 Nov 2018 22:28:45 +0300 Subject: [PATCH] Check if uri scheme is registered so tests won't fall apart --- src/Shared/PlatformSupport/AssetLoader.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Shared/PlatformSupport/AssetLoader.cs b/src/Shared/PlatformSupport/AssetLoader.cs index e67dfa7f57..cea607040d 100644 --- a/src/Shared/PlatformSupport/AssetLoader.cs +++ b/src/Shared/PlatformSupport/AssetLoader.cs @@ -385,10 +385,13 @@ namespace Avalonia.Shared.PlatformSupport public static void RegisterResUriParsers() { - UriParser.Register(new GenericUriParser(GenericUriParserOptions.GenericAuthority | - GenericUriParserOptions.NoUserInfo | - GenericUriParserOptions.NoPort | GenericUriParserOptions.NoQuery | - GenericUriParserOptions.NoFragment), "avares", -1); + if (!UriParser.IsKnownScheme("avares")) + UriParser.Register(new GenericUriParser( + GenericUriParserOptions.GenericAuthority | + GenericUriParserOptions.NoUserInfo | + GenericUriParserOptions.NoPort | + GenericUriParserOptions.NoQuery | + GenericUriParserOptions.NoFragment), "avares", -1); } } }