{"record":{"id":"257df701c2ce1f80","repo":"SixLabors/ImageSharp","slug":"entry-is-null","errorCode":null,"errorMessage":"Entry is null.","messagePattern":"Entry is null\\.","errorType":"exception","errorClass":"InvalidIccProfileException","httpStatus":null,"severity":"error","filePath":"src/ImageSharp/ColorProfiles/Icc/IccConverterbase.Conversions.cs","lineNumber":69,"sourceCode":"            ConversionMethod.ColorTrc => InitColorTrc(profile, toPcs),\n            ConversionMethod.GrayTrc => InitGrayTrc(profile, toPcs),\n            _ => throw new InvalidIccProfileException(\"Invalid conversion method.\"),\n        };\n\n    private static IVector4Calculator InitA(IccProfile profile, IccProfileTag tag)\n        => GetTag(profile, tag) switch\n        {\n            IccLut8TagDataEntry lut8 => new LutEntryCalculator(lut8),\n            IccLut16TagDataEntry lut16 => new LutEntryCalculator(lut16),\n            IccLutAToBTagDataEntry lutAtoB => new LutABCalculator(lutAtoB),\n            IccLutBToATagDataEntry lutBtoA => new LutABCalculator(lutBtoA),\n            _ => throw new InvalidIccProfileException($\"Invalid entry {tag}.\"),\n        };\n\n    private static IVector4Calculator InitD(IccProfile profile, IccProfileTag tag)\n    {\n        IccMultiProcessElementsTagDataEntry entry = GetTag<IccMultiProcessElementsTagDataEntry>(profile, tag)\n            ?? throw new InvalidIccProfileException(\"Entry is null.\");\n\n        throw new NotImplementedException(\"Multi process elements are not supported\");\n    }\n\n    private static ColorTrcCalculator InitColorTrc(IccProfile profile, bool toPcs)\n    {\n        IccXyzTagDataEntry redMatrixColumn = GetTag<IccXyzTagDataEntry>(profile, IccProfileTag.RedMatrixColumn);\n        IccXyzTagDataEntry greenMatrixColumn = GetTag<IccXyzTagDataEntry>(profile, IccProfileTag.GreenMatrixColumn);\n        IccXyzTagDataEntry blueMatrixColumn = GetTag<IccXyzTagDataEntry>(profile, IccProfileTag.BlueMatrixColumn);\n\n        IccTagDataEntry redTrc = GetTag(profile, IccProfileTag.RedTrc);\n        IccTagDataEntry greenTrc = GetTag(profile, IccProfileTag.GreenTrc);\n        IccTagDataEntry blueTrc = GetTag(profile, IccProfileTag.BlueTrc);\n\n        if (redMatrixColumn == null ||\n            greenMatrixColumn == null ||\n            blueMatrixColumn == null ||\n            redTrc == null ||","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/SixLabors/ImageSharp/blob/59ce6af6fc29027cda277ef62d4d1694a8acce91/src/ImageSharp/ColorProfiles/Icc/IccConverterbase.Conversions.cs#L51-L87","documentation":"Thrown by IccConverterBase.InitD when the D2B/B2D tag's data entry cannot be cast to IccMultiProcessElementsTagDataEntry (GetTag<T> returned null), meaning the tag is absent or holds a different entry type. InitD only supports multi-process elements, so a missing entry aborts profile initialization.","triggerScenarios":"Initializing a converter path that calls InitD (the D2B/B2D pipeline) for a profile where the D2Bx/B2Dx tag is missing entirely or contains a non-multiProcessElements entry (e.g. lut16).","commonSituations":"v4/v5 ICC profiles whose D2B tag was not written or was written as a legacy LUT entry; corrupt profile parsing that produced a different entry type for the tag.","solutions":["Ensure the profile actually contains D2B0/B2D0 tags with IccMultiProcessElementsTagDataEntry entries before selecting this conversion path.","Use a profile that routes through the A2B (InitA) LUT path instead of the D2B multi-process path.","Catch InvalidIccProfileException during converter construction and fall back to a supported profile."],"exampleFix":"// before: passing a profile whose D2B0 tag is missing\nvar converter = new IccConverter(profile);\n// after: verify the tag entry type first\nif (profile.Tags.TryGetValue(IccProfileTag.D2B0, out var entry) && entry is IccMultiProcessElementsTagDataEntry)\n{\n    var converter = new IccConverter(profile);\n}","handlingStrategy":"validation","validationCode":"bool hasMpe = profile.Tags.TryGetValue(IccProfileTag.D2B0, out var e)\n    && e is IccMultiProcessElementsTagDataEntry;\nif (!hasMpe) { /* choose the A2B path or a different profile */ }","typeGuard":"if (profile.Tags.TryGetValue(IccProfileTag.D2B0, out var entry)\n    && entry is IccMultiProcessElementsTagDataEntry mpe) { /* safe to use D2B path */ }","tryCatchPattern":null,"preventionTips":["Check for D2B0/B2D0 tags before selecting the D2B conversion path.","Route LUT-based v4 profiles through the A2B path instead.","Validate profiles at load time with a small tag-presence check."],"tags":["icc","color-profile","multi-process-elements"],"backgroundTag":"null-argument","analyzedSha":"59ce6af6fc29027cda277ef62d4d1694a8acce91","analyzedAt":"2026-09-13T18:34:59.331Z","contentChangedAt":"2026-09-13T18:34:59.331Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}