From fc1ec4a58b482df1af243f5b6aa65af8d8e55830 Mon Sep 17 00:00:00 2001 From: Lukas Kirschner Date: Wed, 27 Mar 2024 11:30:37 +0100 Subject: [PATCH] Fixed missing Null check causing NullPointerExceptions when an SVG image is placed inside a DataGridCheckBoxColumn --- Source/SVGImage/SVG/SVGImage.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/SVGImage/SVG/SVGImage.cs b/Source/SVGImage/SVG/SVGImage.cs index b62fc8d..49923be 100644 --- a/Source/SVGImage/SVG/SVGImage.cs +++ b/Source/SVGImage/SVG/SVGImage.cs @@ -872,7 +872,7 @@ static void OnSizeTypeChanged(DependencyObject d, DependencyPropertyChangedEvent static void OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var sourceUri = new Uri(e.NewValue.ToString(), UriKind.Relative); + var sourceUri = e.NewValue != null ? new Uri(e.NewValue.ToString(), UriKind.Relative) : null; var resource = e.NewValue != null ? Application.GetResourceStream(sourceUri) : null; ((SVGImage)d).SetImage(resource != null ? resource.Stream : null); }