diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut16TagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut16TagDataEntry.cs index 6a5d2ca18b..f3807a5849 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut16TagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut16TagDataEntry.cs @@ -60,15 +60,13 @@ namespace ImageSharp public IccLut16TagDataEntry(float[,] matrix, IccLut[] inputValues, IccClut clutValues, IccLut[] outputValues, IccProfileTag tagSignature) : base(IccTypeSignature.Lut16, tagSignature) { + Guard.NotNull(matrix, nameof(matrix)); Guard.NotNull(inputValues, nameof(inputValues)); Guard.NotNull(clutValues, nameof(clutValues)); Guard.NotNull(outputValues, nameof(outputValues)); - if (matrix != null) - { - bool is3By3 = matrix.GetLength(0) == 3 && matrix.GetLength(1) == 3; - Guard.IsTrue(is3By3, nameof(matrix), "Matrix must have a size of three by three"); - } + bool is3By3 = matrix.GetLength(0) == 3 && matrix.GetLength(1) == 3; + Guard.IsTrue(is3By3, nameof(matrix), "Matrix must have a size of three by three"); Guard.IsTrue(this.InputChannelCount == clutValues.InputChannelCount, nameof(clutValues), "Input channel count does not match the CLUT size"); Guard.IsTrue(this.OutputChannelCount == clutValues.OutputChannelCount, nameof(clutValues), "Output channel count does not match the CLUT size"); diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut8TagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut8TagDataEntry.cs index a60943abba..61f17b7568 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut8TagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut8TagDataEntry.cs @@ -60,15 +60,13 @@ namespace ImageSharp public IccLut8TagDataEntry(float[,] matrix, IccLut[] inputValues, IccClut clutValues, IccLut[] outputValues, IccProfileTag tagSignature) : base(IccTypeSignature.Lut8, tagSignature) { + Guard.NotNull(matrix, nameof(matrix)); Guard.NotNull(inputValues, nameof(inputValues)); Guard.NotNull(clutValues, nameof(clutValues)); Guard.NotNull(outputValues, nameof(outputValues)); - if (matrix != null) - { - bool is3By3 = matrix.GetLength(0) == 3 && matrix.GetLength(1) == 3; - Guard.IsTrue(is3By3, nameof(matrix), "Matrix must have a size of three by three"); - } + bool is3By3 = matrix.GetLength(0) == 3 && matrix.GetLength(1) == 3; + Guard.IsTrue(is3By3, nameof(matrix), "Matrix must have a size of three by three"); Guard.IsTrue(this.InputChannelCount == clutValues.InputChannelCount, nameof(clutValues), "Input channel count does not match the CLUT size"); Guard.IsTrue(this.OutputChannelCount == clutValues.OutputChannelCount, nameof(clutValues), "Output channel count does not match the CLUT size");