rspec/rules/S2259/how-dotnet.adoc
Rudy Regazzoni 9aca4314df
Modify S2259: Migrate to LaYC - null dereference (#3337)
## Review

A dedicated reviewer checked the rule description successfully for:

- [ ] logical errors and incorrect information
- [ ] information gaps and missing content
- [ ] text style and tone
- [ ] PR summary and labels follow [the
guidelines](https://github.com/SonarSource/rspec/#to-modify-an-existing-rule)

---------

Co-authored-by: Loris S <91723853+loris-s-sonarsource@users.noreply.github.com>
Co-authored-by: leonardo-pilastri-sonarsource <115481625+leonardo-pilastri-sonarsource@users.noreply.github.com>
2023-10-23 12:29:59 +00:00

17 lines
367 B
Plaintext

== How to fix it
To fix the issue, the access of the `{null-keyword}` value needs to be prevented by either:
* ensuring the variable has a value, or
* by checking if the value is not `{null-keyword}`
=== Code examples
==== Noncompliant code example
include::{language}/noncompliant-code.adoc[]
==== Compliant solution
include::{language}/compliant-code.adoc[]