{"record":{"id":"b5f6b04665ca93dd","repo":"stride3d/stride","slug":"index-cannot-be-empty","errorCode":null,"errorMessage":"index cannot be empty.","messagePattern":"index cannot be empty\\.","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"sources/presentation/Stride.Core.Quantum/ObjectNode.cs","lineNumber":152,"sourceCode":"        else if (Descriptor is DictionaryDescriptor dictionaryDescriptor)\n        {\n            var args = new ItemChangeEventArgs(this, itemIndex, ContentChangeType.CollectionAdd, null, newItem);\n            NotifyItemChanging(args);\n            dictionaryDescriptor.AddToDictionary(value, itemIndex.Value, newItem);\n            UpdateReferences();\n            NotifyItemChanged(args);\n        }\n        else\n        {\n            throw new NotSupportedException(\"Unable to set the node value, the collection is unsupported\");\n        }\n    }\n\n    /// <inheritdoc/>\n    public void Remove(object item, NodeIndex itemIndex)\n    {\n        if (!itemIndex.TryGetValue(out var itemIndexValue))\n            throw new ArgumentException(\"index cannot be empty.\", nameof(itemIndex));\n\n        var args = new ItemChangeEventArgs(this, itemIndex, ContentChangeType.CollectionRemove, item, null);\n        NotifyItemChanging(args);\n        if (Descriptor is CollectionDescriptor collectionDescriptor)\n        {\n            if (collectionDescriptor.HasRemoveAt)\n            {\n                collectionDescriptor.RemoveAt(value, itemIndex.Int);\n            }\n            else\n            {\n                collectionDescriptor.Remove(value, item);\n            }\n        }\n        else if (Descriptor is DictionaryDescriptor dictionaryDescriptor)\n        {\n            dictionaryDescriptor.Remove(value, itemIndexValue);\n        }","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/presentation/Stride.Core.Quantum/ObjectNode.cs#L134-L170","documentation":"A validation guard in ObjectNode's item removal path: the itemIndex is null or empty when Remove is called. Removing an item from an indexed collection (list or dictionary) node requires a valid NodeIndex identifying which entry to remove; an empty index cannot address any item, so the operation is rejected. This fires when quantum graph code attempts a collection removal without specifying the target index.","triggerScenarios":"Thrown at sources/presentation/Stride.Core.Quantum/ObjectNode.cs:152 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Supply the real NodeIndex of the item being removed (obtained from IndexOf/ItemReferences or during enumeration), not NodeIndex.Empty.","Only call Remove on collection-backed nodes; for members use the member-node removal APIs instead.","Guard the call site so a failed index lookup does not fall through to Remove with an empty index."],"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-23T08:17:48.524Z"}