This feature request aims to enhance the code analyzer library by adding a rule that enforces the use of the null conditional operator (?.) for event invocations in C# code. This will help developers avoid NullReferenceExceptions and ensure thread-safe event handling.
Goals
Detect event invocation patterns that do not use the null conditional operator.
Suggest refactoring to use the null conditional operator for safe and concise event invocation.
Improve code readability and maintainability.
Reduce potential bugs related to thread safety and null reference issues.
https://github.com/BillWagner/EffectiveCSharpAnalyzers/issues/8
Summary
This feature request aims to enhance the code analyzer library by adding a rule that enforces the use of the null conditional operator (?.) for event invocations in C# code. This will help developers avoid
NullReferenceExceptions
and ensure thread-safe event handling.Goals