Skip to content

Commit 0ec523f

Browse files
committed
Add null check for PixelComponentInfo in Rgb96_PixelInformation()
1 parent 3fbf0ef commit 0ec523f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tests/ImageSharp.Tests/PixelFormats/Rgb96Tests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,10 @@ public void Rgb96_PixelInformation()
297297
Assert.Equal(PixelAlphaRepresentation.None, info.AlphaRepresentation);
298298
Assert.Equal(PixelColorType.RGB, info.ColorType);
299299

300-
PixelComponentInfo componentInfo = info.ComponentInfo.Value;
300+
PixelComponentInfo? maybeComponentInfo = info.ComponentInfo;
301+
Assert.NotNull(maybeComponentInfo);
302+
PixelComponentInfo componentInfo = maybeComponentInfo.Value;
303+
301304
Assert.Equal(3, componentInfo.ComponentCount);
302305
Assert.Equal(0, componentInfo.Padding);
303306
Assert.Equal(32, componentInfo.GetComponentPrecision(0));

0 commit comments

Comments
 (0)