{"record":{"id":"52916b69c853d824","repo":"stride3d/stride","slug":"a-graphnode-cannot-have-children-when-its-content-hold-a","errorCode":null,"errorMessage":"A GraphNode cannot have children when its content hold a reference.","messagePattern":"A GraphNode cannot have children when its content hold a reference\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/presentation/Stride.Core.Quantum/ObjectNode.cs","lineNumber":270,"sourceCode":"            return enumRef.Indices;\n\n        return GetIndices(this);\n    }\n\n    public override string ToString()\n    {\n        return $\"{{Node: Object {Type.Name} = [{Value}]}}\";\n    }\n\n    /// <inheritdoc/>\n    void IInitializingObjectNode.AddMember(IMemberNode member, bool allowIfReference)\n    {\n        if (IsSealed)\n            throw new InvalidOperationException(\"Unable to add a child to a GraphNode that has been sealed\");\n\n        // ReSharper disable once HeuristicUnreachableCode - this code is reachable only at the specific moment we call this method!\n        if (ItemReferences != null && !allowIfReference)\n            throw new InvalidOperationException(\"A GraphNode cannot have children when its content hold a reference.\");\n\n        childrenMap.Add(member.Name, (MemberNode)member);\n    }\n}\n","sourceCodeStart":252,"sourceCodeEnd":275,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/presentation/Stride.Core.Quantum/ObjectNode.cs#L252-L275","documentation":"Thrown by ObjectNode.AddMember when the node's content holds an ItemReferences (a reference to another object). A node that holds a reference to an external object cannot also own child member nodes — the reference and children are mutually exclusive representations of the node content. This fires when initialization tries to add a member to a node whose content was replaced by (or initialized from) a reference, which would produce an inconsistent graph.","triggerScenarios":"Thrown at sources/presentation/Stride.Core.Quantum/ObjectNode.cs:270 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not add member nodes to a node whose content is an ObjectReference; such nodes are opaque reference holders by design.","Resolve the reference first and attach/modify members on the target node (via the reference's TargetNode) instead of on the referencing node.","Restructure the model so reference-holding properties are leaves in the graph, or remove the reference before rebuilding children."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}