Modify rule S1696: Fix link (#3736)
This commit is contained in:
parent
413b689086
commit
e29edd12ed
@ -13,7 +13,7 @@ Instead of catching NullReferenceException, it's better to prevent it from happe
|
|||||||
|
|
||||||
[source,csharp,diff-id=1,diff-type=noncompliant]
|
[source,csharp,diff-id=1,diff-type=noncompliant]
|
||||||
----
|
----
|
||||||
public int GetLengthPlusTwo(string str)
|
public int GetLengthPlusTwo(string str)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -46,6 +46,6 @@ public int GetLengthPlusTwo(string str)
|
|||||||
|
|
||||||
* CWE - https://cwe.mitre.org/data/definitions/395[CWE-395 - Use of NullPointerException Catch to Detect NULL Pointer Dereference]
|
* CWE - https://cwe.mitre.org/data/definitions/395[CWE-395 - Use of NullPointerException Catch to Detect NULL Pointer Dereference]
|
||||||
* Microsoft Learn - https://learn.microsoft.com/en-us/dotnet/api/system.nullreferenceexception[NullReferenceException class]
|
* Microsoft Learn - https://learn.microsoft.com/en-us/dotnet/api/system.nullreferenceexception[NullReferenceException class]
|
||||||
* Microsoft Learn - https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/member-access-operators#null-conditional-operators--and-[Null-conditional operators ?. and ?[]]
|
* Microsoft Learn - https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/member-access-operators#null-conditional-operators\--and-[Null-conditional operators ?. and ?[\]]
|
||||||
|
|
||||||
include::../rspecator.adoc[]
|
include::../rspecator.adoc[]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user