From 0ec523f0689a4b022ab09eac4f911d7b99ec65e4 Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Tue, 7 Apr 2026 18:21:03 +0200 Subject: [PATCH] Add null check for PixelComponentInfo in Rgb96_PixelInformation() --- tests/ImageSharp.Tests/PixelFormats/Rgb96Tests.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/ImageSharp.Tests/PixelFormats/Rgb96Tests.cs b/tests/ImageSharp.Tests/PixelFormats/Rgb96Tests.cs index 7c6f6bebd7..7e6b8f55f5 100644 --- a/tests/ImageSharp.Tests/PixelFormats/Rgb96Tests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/Rgb96Tests.cs @@ -297,7 +297,10 @@ public class Rgb96Tests Assert.Equal(PixelAlphaRepresentation.None, info.AlphaRepresentation); Assert.Equal(PixelColorType.RGB, info.ColorType); - PixelComponentInfo componentInfo = info.ComponentInfo.Value; + PixelComponentInfo? maybeComponentInfo = info.ComponentInfo; + Assert.NotNull(maybeComponentInfo); + PixelComponentInfo componentInfo = maybeComponentInfo.Value; + Assert.Equal(3, componentInfo.ComponentCount); Assert.Equal(0, componentInfo.Padding); Assert.Equal(32, componentInfo.GetComponentPrecision(0));