{"record":{"id":"070ca6e04c2a2447","repo":"stride3d/stride","slug":"views","errorCode":null,"errorMessage":"views","messagePattern":"views","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Rendering/Rendering/Images/ImageEffect.cs","lineNumber":121,"sourceCode":"        /// <summary>\n        /// Sets the render target output.\n        /// </summary>\n        /// <param name=\"view\">The render target output view.</param>\n        /// <exception cref=\"System.ArgumentNullException\">view</exception>\n        public void SetOutput(Texture view)\n        {\n            if (view == null) throw new ArgumentNullException(\"view\");\n\n            SetOutputInternal(view);\n        }\n\n        /// <summary>\n        /// Sets the render target outputs.\n        /// </summary>\n        /// <param name=\"views\">The render target output views.</param>\n        public void SetOutput(params Texture[] views)\n        {\n            if (views == null) throw new ArgumentNullException(\"views\");\n\n            SetOutputInternal(views);\n        }\n\n        /// <summary>\n        /// Sets the render target output.\n        /// </summary>\n        /// <param name=\"depthStencilView\">The depth stencil output view.</param>\n        /// <param name=\"renderTargetView\">The render target output view.</param>\n        public void SetDepthOutput(Texture depthStencilView, Texture renderTargetView)\n        {\n            outputDepthStencilView = depthStencilView;\n            outputRenderTargetView = renderTargetView;\n            outputRenderTargetViews = null;\n        }\n\n        /// <summary>\n        /// Sets the render target outputs.","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Rendering/Rendering/Images/ImageEffect.cs#L103-L139","documentation":"The params-array overload of SetOutput throws ArgumentNullException(\"views\") when the caller passes a null array. Unlike the single-texture overload, it does not reject an empty array here — only a null array reference triggers this error.","triggerScenarios":"Calling effect.SetOutput() with an explicitly null Texture[] (note: effect.SetOutput() with zero arguments passes an empty array, not null, and does NOT throw this).","commonSituations":"Storing output views in a field initialized later, then invoking SetOutput(views) with the still-null field in C#; passing an expression that evaluates to null due to a failed texture array allocation.","solutions":["Initialize the Texture[] array before calling SetOutput","Pass at least one texture to the params overload","Guard: if (views == null) return;"],"exampleFix":"// before\nTexture[] outputs = null;\neffect.SetOutput(outputs);\n// after\nTexture[] outputs = new Texture[] { renderTarget };\neffect.SetOutput(outputs);","handlingStrategy":"validation","validationCode":"if (views == null || views.Length == 0) throw new InvalidOperationException(\"At least one output texture required\");","typeGuard":"bool IsValidOutputs(Texture[] views) => views != null && views.All(v => v != null);","tryCatchPattern":"try { effect.SetOutput(views); } catch (ArgumentNullException) { /* supply initialized array */ }","preventionTips":["Initialize output arrays at effect setup, not lazily at draw","Pass textures directly via params rather than null-capable arrays","Add Debug.Assert(views != null) before calls"],"tags":["null-argument","rendering","csharp"],"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"}