From c2ae341bec0b07b490666fa732fc6fccd42046d1 Mon Sep 17 00:00:00 2001 From: Mgamerz Date: Mon, 25 Nov 2019 20:24:14 -0700 Subject: [PATCH] Fix exception thrown when changing themes when application uses relative and absolute URIs --- AdonisUI/ResourceLocator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AdonisUI/ResourceLocator.cs b/AdonisUI/ResourceLocator.cs index ea398ca..031d46a 100644 --- a/AdonisUI/ResourceLocator.cs +++ b/AdonisUI/ResourceLocator.cs @@ -40,7 +40,7 @@ public static void SetColorScheme(ResourceDictionary rootResourceDictionary, Uri private static ResourceDictionary FindColorSchemeInResources(ResourceDictionary resourceDictionary, Uri[] knownColorSchemes) { - if (knownColorSchemes.Any(scheme => resourceDictionary.Source != null && resourceDictionary.Source.AbsoluteUri.Equals(scheme.AbsoluteUri))) + if (knownColorSchemes.Any(scheme => resourceDictionary.Source != null && resourceDictionary.Source.IsAbsoluteUri && resourceDictionary.Source.AbsoluteUri.Equals(scheme.AbsoluteUri))) return resourceDictionary; if (!resourceDictionary.MergedDictionaries.Any()) @@ -63,4 +63,4 @@ private static bool RemoveResourceDictionaryFromResourcesDeep(ResourceDictionary return rootResourceDictionary.MergedDictionaries.Any(dict => RemoveResourceDictionaryFromResourcesDeep(resourceDictionaryToRemove, dict)); } } -} \ No newline at end of file +}