{"record":{"id":"06defcefcf95e6f2","repo":"stride3d/stride","slug":"unable-to-add-a-child-to-a-graphnode-that-has-been-sealed","errorCode":null,"errorMessage":"Unable to add a child to a GraphNode that has been sealed","messagePattern":"Unable to add a child to a GraphNode that has been sealed","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/presentation/Stride.Core.Quantum/ObjectNode.cs","lineNumber":266,"sourceCode":"    private IEnumerable<NodeIndex>? GetIndices()\n    {\n        var enumRef = ItemReferences;\n        if (enumRef != null)\n            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":248,"sourceCodeEnd":275,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/presentation/Stride.Core.Quantum/ObjectNode.cs#L248-L275","documentation":"Thrown by ObjectNode.AddMember (IInitializingObjectNode.AddMember) when the node IsSealed. During graph construction the node container adds member nodes to a new ObjectNode; once construction finishes the node is sealed and its children become immutable. Adding a member afterwards would break the invariant that the graph structure is fixed after build, so an InvalidOperationException is thrown. This fires from code touching the graph outside the initialization window.","triggerScenarios":"Thrown at sources/presentation/Stride.Core.Quantum/ObjectNode.cs:266 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add all members during node construction/build, before the graph is sealed; check IsSealed before calling AddMember.","If members must be added late, rebuild or recreate the node graph instead of mutating a sealed node.","Find the code path that seals the graph too early (e.g. BuildGraph completing) and move late AddMember calls before it."],"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"}