{"record":{"id":"f516b54da9526210","repo":"stride3d/stride","slug":"value-cannot-be-null-parameter-e","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'e')","messagePattern":"Value cannot be null\\. \\(Parameter 'e'\\)","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.UI/UIElement.Events.cs","lineNumber":165,"sourceCode":"                RoutedEventHandlerInfoListPool.Enqueue(pooledList);\n            }\n\n            // propagate afterwards if bubbling\n            if (routedEvent.RoutingStrategy == RoutingStrategy.Bubble)\n                VisualParent?.PropagateRoutedEvent(e);\n        }\n\n        /// <summary>\n        /// Raises a specific routed event. The <see cref=\"RoutedEvent\"/> to be raised is identified within the <see cref=\"RoutedEventArgs\"/> instance \n        /// that is provided (as the <see cref=\"RoutedEvent\"/> property of that event data).\n        /// </summary>\n        /// <param name=\"e\">A <see cref=\"RoutedEventArgs\"/> that contains the event data and also identifies the event to raise.</param>\n        /// <exception cref=\"ArgumentNullException\"><paramref name=\"e\"/> is null.</exception>\n        /// <exception cref=\"InvalidOperationException\">The type of the routed event argument <paramref name=\"e\"/> does not match the event handler second argument type.</exception>\n        public void RaiseEvent(RoutedEventArgs e)\n        {\n            if (e == null)\n                throw new ArgumentNullException(nameof(e));\n\n            if (e.RoutedEvent == null)\n                return;\n\n            if (!e.RoutedEvent.HandlerSecondArgumentType.GetTypeInfo().IsAssignableFrom(e.GetType().GetTypeInfo()))\n                throw new InvalidOperationException(\"The type of second parameter of the handler (\" + e.RoutedEvent.HandlerSecondArgumentType\n                                                    + \") is not assignable from the parameter 'e' type (\" + e.GetType() + \").\");\n\n            var sourceWasNull = e.Source == null;\n            if (sourceWasNull) // set the source to default if needed\n                e.Source = this;\n\n            e.StartEventRouting();\n\n            PropagateRoutedEvent(e);\n\n            e.EndEventRouting();\n","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.UI/UIElement.Events.cs#L147-L183","documentation":"Argument-null validation in UIElement.RaiseEvent: the RoutedEventArgs e is null. RaiseEvent identifies which RoutedEvent to raise from the event data carried in e; without it nothing can be routed, so it throws ArgumentNullException named 'e', exactly as the method's <exception> documentation declares. All the RaiseTouch*/RaiseKeyPressed helpers pass constructed event args, so this fires when user code calls RaiseEvent with null.","triggerScenarios":"Thrown at sources/engine/Stride.UI/UIElement.Events.cs:165 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-null RoutedEventArgs (or a derived type matching the RoutedEvent) to RaiseEvent.","Construct the event args at the call site — e.g. in RaiseTouchDownEvent/RaiseKeyPressedEvent helpers — before raising, and never forward a null args reference.","Guard call sites where event args come from an external source (input pipeline, pooling) and may be null."],"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"}