Skip to content

Commit fef9695

Browse files
committed
Fix value null exception when bindable inlines change
1 parent cc09e50 commit fef9695

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

H2MLauncher.UI/View/Behaviors/TextBlockExtensions.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ private static void OnBindableInlinesChanged(DependencyObject d, DependencyPrope
2828
return;
2929
}
3030

31-
if (target != null)
31+
if (target is not null)
3232
{
3333
target.Inlines.Clear();
34-
target.Inlines.AddRange(((System.Collections.IEnumerable)e.NewValue));
34+
35+
if (e.NewValue is not null)
36+
{
37+
target.Inlines.AddRange(((System.Collections.IEnumerable)e.NewValue));
38+
}
3539
}
3640
}
3741
}

0 commit comments

Comments
 (0)