{"record":{"id":"2a7fbefbc3f0364d","repo":"stride3d/stride","slug":"colortransformshader","errorCode":null,"errorMessage":"colorTransformShader","messagePattern":"colorTransformShader","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Rendering/Rendering/Images/ColorTransforms/ColorTransformBase.cs","lineNumber":29,"sourceCode":"\nnamespace Stride.Rendering.Images\n{\n    /// <summary>\n    /// Base class for a <see cref=\"ColorTransformBase\"/> used by <see cref=\"ColorTransform\"/> and <see cref=\"ToneMapOperator\"/>.\n    /// </summary>\n    [DataContract(Inherited = true)]\n    public abstract class ColorTransformBase\n    {\n        private ParameterCollection.CompositionCopier parameterCompositionCopier;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"ColorTransformBase\" /> class.\n        /// </summary>\n        /// <param name=\"colorTransformShader\">Name of the shader.</param>\n        /// <exception cref=\"System.ArgumentNullException\">shaderName</exception>\n        protected ColorTransformBase(string colorTransformShader)\n        {\n            if (colorTransformShader == null) throw new ArgumentNullException(\"colorTransformShader\");\n            Parameters = new ParameterCollection();\n\n            // Initialize all Parameters with values coming from each ParameterKey\n            InitializeProperties();\n\n            Shader = new ShaderMixinGeneratorSource(colorTransformShader);\n        }\n\n        /// <summary>\n        /// Gets the group this <see cref=\"ColorTransformBase\" /> is associated with.\n        /// </summary>\n        [DataMemberIgnore]\n        public ColorTransformGroup Group { get; internal set; }\n\n        /// <summary>\n        /// Gets or sets the shader source for this color transform.\n        /// </summary>\n        [DataMemberIgnore]","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Rendering/Rendering/Images/ColorTransforms/ColorTransformBase.cs#L11-L47","documentation":"The protected ColorTransformBase(string colorTransformShader) constructor throws ArgumentNullException when the shader name is null. Color transforms are shader-driven image effects; the name is used to build a ShaderMixinGeneratorSource, which cannot be created from null. The doc comment also documents this as ArgumentNullException for the shader name.","triggerScenarios":"Calling a derived color-transform class constructor with a null shader name, e.g. new MyTransform(null), usually when the name is passed through from configuration or a constant that is null.","commonSituations":"Custom ColorTransform subclasses forwarding an uninitialized name field; config-driven effect pipelines where the transform's shader entry is missing.","solutions":["Pass a non-null shader name when invoking the base constructor of your ColorTransform subclass.","Validate the configured shader name before constructing the transform.","Define the shader name as a compile-time constant in the subclass to avoid nulls."],"exampleFix":"// before\npublic MyTransform() : base(shaderName) { } // shaderName null\n// after\npublic MyTransform() : base(\"MyTransformShader\") { }","handlingStrategy":"validation","validationCode":"if (string.IsNullOrEmpty(name)) throw new ArgumentException(\"Shader name required\");\nbase(name);","typeGuard":"bool IsValid(string s) => !string.IsNullOrEmpty(s);","tryCatchPattern":"try { var t = new MyTransform(name); }\ncatch (ArgumentNullException ex) { Log.Error(ex, \"Color transform shader name missing\"); }","preventionTips":["Pass shader names as compile-time constants in subclasses","Never forward nullable config strings directly to base constructors","Chain-validate constructor arguments before base calls where possible"],"tags":["null-argument","shader","color-transform"],"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"}