{"record":{"id":"e5312ec2deca14e0","repo":"stride3d/stride","slug":"unable-to-retrieve-the-value-at-the-given-index-this","errorCode":null,"errorMessage":"Unable to retrieve the value at the given index, this collection is unsupported","messagePattern":"Unable to retrieve the value at the given index, this collection is unsupported","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"sources/presentation/Stride.Core.Quantum/Internal/Content.cs","lineNumber":39,"sourceCode":"    {\n        if (!index.TryGetValue(out var indexValue))\n            return value;\n\n        ArgumentNullException.ThrowIfNull(value);\n\n        if (descriptor is CollectionBaseDescriptor collectionBaseDescriptor)\n        {\n            return collectionBaseDescriptor.GetValue(value, indexValue);\n        }\n\n        // Try with the concrete type descriptor\n        var objectDescriptor = TypeDescriptorFactory.Default.Find(value.GetType());\n        if (objectDescriptor != descriptor)\n        {\n            return Retrieve(value, index, objectDescriptor);\n        }\n\n        throw new NotSupportedException(\"Unable to retrieve the value at the given index, this collection is unsupported\");\n    }\n}\n","sourceCodeStart":21,"sourceCodeEnd":42,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/presentation/Stride.Core.Quantum/Internal/Content.cs#L21-L42","documentation":"Content.Retrieve throws NotSupportedException when it cannot retrieve a value at the given index: the value is neither the content's own value nor retrievable through the expected descriptor, meaning the underlying object is an unsupported collection/value shape.","triggerScenarios":"Calling Retrieve(value, index) on a Content where value's type resolves to the same descriptor but the value does not implement the indexer accessors needed (non-indexed collection or non-boxable type), so neither recursion branch applies.","commonSituations":"Accessing items of collections lacking indexer accessors through the Quantum API; descriptor mismatches after type changes; passing a wrong value object into Content retrieval APIs.","solutions":["Ensure the underlying collection exposes indexer accessors (switch to List<T>/array/Dictionary)","Verify the value passed to Retrieve actually belongs to this content (correct root object)","Update descriptors/type registrations so the descriptor matches the value's type","Catch NotSupportedException and handle the member outside the Quantum graph"],"exampleFix":"// before\ncontent.Retrieve(myHashSet, index); // no indexer\n// after\nvar list = myCollection.ToList();\ncontent.Retrieve(list, NodeIndex.New(i));","handlingStrategy":"validation","validationCode":"var d = TypeDescriptorFactory.Default.Find(value.GetType()); if (d is CollectionDescriptor cd && !cd.HasIndexerAccessors) throw new InvalidOperationException($\"Collection {value.GetType()} is unsupported for indexed retrieval\");","typeGuard":"bool SupportsIndexedRetrieve(object v) => v is System.Collections.IList || v is System.Collections.IDictionary;","tryCatchPattern":"try { var v = content.Retrieve(value, index); } catch (NotSupportedException ex) { // handle member outside the graph }","preventionTips":["Only pass indexer-backed collections to Quantum retrieval APIs","Confirm the value belongs to the content's root object","Keep model collections in types supported by CollectionDescriptor"],"tags":["collections","unsupported","quantum"],"backgroundTag":"unsupported-operation","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"}