{"record":{"id":"4dd1d83aa8cca932","repo":"stride3d/stride","slug":"compiler","errorCode":null,"errorMessage":"compiler","messagePattern":"compiler","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"sources/shaders/Stride.Shaders.Effects/Compiler/EffectCompilerChain.cs","lineNumber":21,"sourceCode":"using System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing Stride.Core.Diagnostics;\nusing Stride.Core.IO;\nusing Stride.Core.Storage;\n\nnamespace Stride.Shaders.Compiler\n{\n    /// <summary>\n    /// Helper class that delegates actual compilation to another <see cref=\"IEffectCompiler\"/>.\n    /// </summary>\n    public class EffectCompilerChain : EffectCompilerBase\n    {\n        private readonly EffectCompilerBase compiler;\n\n        public EffectCompilerChain(EffectCompilerBase compiler)\n        {\n            if (compiler == null) throw new ArgumentNullException(\"compiler\");\n            this.compiler = compiler;\n        }\n\n        protected EffectCompilerBase Compiler\n        {\n            get { return compiler; }\n        }\n\n        public override IVirtualFileProvider FileProvider\n        {\n            get { return compiler.FileProvider; }\n            set { compiler.FileProvider = value; }\n        }\n\n        protected override void Destroy()\n        {\n            compiler.Dispose();\n","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/shaders/Stride.Shaders.Effects/Compiler/EffectCompilerChain.cs#L3-L39","documentation":"EffectCompilerChain decorates another EffectCompilerBase; the constructor requires a non-null inner compiler and throws ArgumentNullException(\"compiler\") otherwise. The chain cannot forward compile requests without it.","triggerScenarios":"new EffectCompilerChain(null), usually from a factory or DI setup where the base compiler failed to construct or was not registered.","commonSituations":"Building compiler chains (cache/scheduler wrappers) before the underlying compiler is initialized; conditional compiler setup paths that skip compiler creation.","solutions":["Construct the inner compiler (e.g. EffectCompiler or platform compiler) before wrapping it.","Verify DI/factory registration for the base EffectCompilerBase.","Guard the construction site and surface a clearer error when the base compiler is unavailable."],"exampleFix":"// before\nvar chain = new EffectCompilerChain(baseCompiler); // baseCompiler is null\n// after\nvar baseCompiler = new EffectCompiler(fileProvider);\nvar chain = new EffectCompilerChain(baseCompiler);","handlingStrategy":"validation","validationCode":"if (baseCompiler == null) throw new InvalidOperationException(\"Inner compiler must be constructed before EffectCompilerChain\");","typeGuard":"null","tryCatchPattern":"try { var chain = new EffectCompilerChain(baseCompiler); } catch (ArgumentNullException ex) when (ex.ParamName == \"compiler\") { /* construct base compiler and retry */ }","preventionTips":["Construct the base compiler first in factory code","Check DI registration order for compiler services","Return early with a clear error when compiler creation fails"],"tags":["null-argument","compiler-chain"],"backgroundTag":"null-argument","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}