{"record":{"id":"a5be30fe27b9fc37","repo":"stride3d/stride","slug":"transform","errorCode":null,"errorMessage":"transform","messagePattern":"transform","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Rendering/Rendering/Images/ColorTransforms/ColorTransformGroup.cs","lineNumber":157,"sourceCode":"        protected virtual void CollectPreTransforms()\n        {\n            foreach (var transform in preTransforms)\n            {\n                AddTemporaryTransform(transform);\n            }\n        }\n\n        protected virtual void CollectPostTransforms()\n        {\n            foreach (var transform in postTransforms)\n            {\n                AddTemporaryTransform(transform);\n            }\n        }\n\n        protected void AddTemporaryTransform(ColorTransform transform)\n        {\n            if (transform == null) throw new ArgumentNullException(\"transform\");\n            if (transform.Shader == null) throw new ArgumentOutOfRangeException(\"transform\", \"Transform parameter must have a Shader not null\");\n            if (transform.Enabled)\n                collectTransforms.Add(transform);\n        }\n\n        private bool CollectTransforms()\n        {\n            collectTransforms.Clear();\n            CollectPreTransforms();\n            foreach (var transform in transforms)\n            {\n                AddTemporaryTransform(transform);\n            }\n            CollectPostTransforms();\n\n            // Copy all parameters from ColorTransform to effect parameters\n            if (collectTransforms.Count != enabledTransforms.Count)\n            {","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Rendering/Rendering/Images/ColorTransforms/ColorTransformGroup.cs#L139-L175","documentation":"AddTemporaryTransform in ColorTransformGroup throws ArgumentNullException when a ColorTransform with a null reference is added. This method is invoked from CollectPreTransforms, CollectPostTransforms, and CollectTransforms while assembling the transform list for the group, so a null entry would corrupt the collected pipeline.","triggerScenarios":"A collection of transforms (pre/post/main) contains a null element, e.g. a List<ColorTransform> with a null added, which is then passed through the Collect* methods that call AddTemporaryTransform per element.","commonSituations":"Building transform lists from config where some entries fail to construct; adding null to a transform list as a placeholder; deserialization producing null entries for missing transforms.","solutions":["Remove null entries from your transform collections before the group collects them.","Check each ColorTransform instance for null before adding it to PreTransforms/PostTransforms/Transforms.","Fix the construction code that is producing null transforms."],"exampleFix":"// before\ntransforms.Add(null);\n// after\nif (transform != null) transforms.Add(transform);","handlingStrategy":"validation","validationCode":"transforms.RemoveAll(t => t == null);\ngroup.PostTransforms.AddRange(transforms);","typeGuard":"bool AddIfPresent(List<ColorTransform> list, ColorTransform t) { if (t == null) return false; list.Add(t); return true; }","tryCatchPattern":"try { group.PostTransforms.AddRange(collected); }\ncatch (ArgumentNullException ex) { Log.Error(ex, \"Null transform in collection\"); }","preventionTips":["Reject null entries at collection-build time","Fix deserializers to skip or default missing transforms","Use non-nullable collection element types"],"tags":["null-argument","color-transform","pipeline"],"backgroundTag":"null-argument","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}