{"record":{"id":"c443301189e67fd1","repo":"stride3d/stride","slug":"attributes-can-not-be-null","errorCode":null,"errorMessage":"Attributes can not be null","messagePattern":"Attributes can not be null","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"sources/core/Stride.Core.Yaml/Serialization/SerializerSettings.cs","lineNumber":274,"sourceCode":"                    throw new ArgumentException(\n                        \"Expecting length >= 2 and at least a special character '.', '~', '-' (not starting on first char for '-')\");\n                }\n\n                specialCollectionMember = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets the attribute registry.\n        /// </summary>\n        /// <value>The attribute registry.</value>\n        public IAttributeRegistry Attributes\n        {\n            get { return attributeRegistry; }\n            set\n            {\n                if (value == null)\n                    throw new ArgumentNullException(\"value\", $\"{nameof(Attributes)} can not be null\");\n                attributeRegistry = value;\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the ObjectSerializerBackend. Default implementation is <see cref=\"DefaultObjectSerializerBackend\"/>\n        /// </summary>\n        /// <value>The ObjectSerializerBackend.</value>\n        public IObjectSerializerBackend ObjectSerializerBackend\n        {\n            get { return objectSerializerBackend; }\n            set\n            {\n                if (value == null)\n                    throw new ArgumentNullException(\"value\", $\"{nameof(ObjectSerializerBackend)} can not be null\");\n                objectSerializerBackend = value;\n            }\n        }","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/core/Stride.Core.Yaml/Serialization/SerializerSettings.cs#L256-L292","documentation":"SerializerSettings.Attributes must reference an IAttributeRegistry used to look up custom attributes during serialization. Assigning null throws ArgumentNullException since attribute resolution is a required component of the pipeline.","triggerScenarios":"`settings.Attributes = null`, or passing a registry obtained from a failed service lookup.","commonSituations":"Custom serializer bootstrap code where the registry is resolved lazily and can be null; copying settings between environments.","solutions":["Assign a live IAttributeRegistry instance (e.g. the registry provided by the service registry / AssetRegistry)","Initialize the registry before constructing SerializerSettings"],"exampleFix":"// before\nsettings.Attributes = null;\n// after\nsettings.Attributes = new AttributeRegistry();","handlingStrategy":"validation","validationCode":"settings.Attributes = attributeRegistry ?? new AttributeRegistry();","typeGuard":null,"tryCatchPattern":"try { settings.Attributes = registry; } catch (ArgumentNullException) { settings.Attributes = new AttributeRegistry(); }","preventionTips":["Initialize the attribute registry before building serializer settings","Null-check service-resolution results before assignment"],"tags":["yaml","serialization","null-argument","configuration"],"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"}