Skip to content

Commit 73082b3

Browse files
authored
Fixing potential null reference exception. (#1037)
Chaning Uri comparision to be case insensitive.
1 parent 569ff42 commit 73082b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

MaterialDesignThemes.Wpf/ThemeAssist.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ private static void OnThemeChanged(DependencyObject @do, DependencyPropertyChang
2727
{
2828
foreach(ResourceDictionary resourceDictionary in element.Resources.MergedDictionaries)
2929
{
30-
if (string.Equals(resourceDictionary.Source.ToString(), oldSource, StringComparison.Ordinal))
30+
if (string.Equals(resourceDictionary.Source?.ToString(), oldSource, StringComparison.OrdinalIgnoreCase))
3131
{
3232
element.Resources.MergedDictionaries.Remove(resourceDictionary);
3333
break;

0 commit comments

Comments
 (0)