{"record":{"id":"009f8091ed0b2234","repo":"stride3d/stride","slug":"simulated-pointerdevice-does-not-exist","errorCode":null,"errorMessage":"Simulated PointerDevice does not exist","messagePattern":"Simulated PointerDevice does not exist","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Input/Simulated/InputSourceSimulated.cs","lineNumber":118,"sourceCode":"        public void RemoveAllKeyboards()\n        {\n            foreach (var keyboard in keyboards)\n                UnregisterDevice(keyboard);\n            keyboards.Clear();\n        }\n\n        public PointerSimulated AddPointer()\n        {\n            var pointer = new PointerSimulated(this);\n            pointers.Add(pointer);\n            RegisterDevice(pointer);\n            return pointer;\n        }\n\n        public void RemovePointer(PointerSimulated pointer)\n        {\n            if (!pointers.Contains(pointer))\n                throw new InvalidOperationException(\"Simulated PointerDevice does not exist\");\n            UnregisterDevice(pointer);\n            pointers.Remove(pointer);\n        }\n\n        public void RemoveAllPointers()\n        {\n            foreach (var pointer in pointers)\n                UnregisterDevice(pointer);\n            pointers.Clear();\n        }\n    }\n}\n","sourceCodeStart":100,"sourceCodeEnd":131,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Input/Simulated/InputSourceSimulated.cs#L100-L131","documentation":"InputSourceSimulated.RemovePointer requires the PointerSimulated instance to be in the source's pointers collection. If the pointer was never created by this source or has already been removed, the check fails and InvalidOperationException is thrown.","triggerScenarios":"Calling RemovePointer with a pointer not obtained from this source's CreatePointer, or a duplicate RemovePointer call for the same instance.","commonSituations":"Double teardown of test fixtures; pointers removed via RemoveAllPointers then removed individually; passing pointers between separate InputSourceSimulated instances.","solutions":["Only remove PointerSimulated instances created by this source","Check membership or track removed pointers before removal","Use RemoveAllPointers for complete cleanup","Clear references after removal to prevent stale calls"],"exampleFix":"// before\nsource.RemovePointer(pointer);\nsource.RemovePointer(pointer); // throws\n// after\nif (pointers.Contains(pointer)) source.RemovePointer(pointer);","handlingStrategy":"validation","validationCode":"if (createdPointers.Contains(pointer)) source.RemovePointer(pointer);","typeGuard":null,"tryCatchPattern":"try { source.RemovePointer(pointer); } catch (InvalidOperationException) { /* already removed */ }","preventionTips":["Only remove pointers created by this source instance","Clear references after removal","Use RemoveAllPointers for teardown"],"tags":["input","simulated","pointer","entity-not-found"],"backgroundTag":"resource-not-found","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"}