21 lines
596 B
Plaintext
21 lines
596 B
Plaintext
The variable `MyObject` is equal to `Nothing`, meaning it has no value:
|
|
|
|
[source,vbnet,diff-id=1,diff-type=noncompliant]
|
|
----
|
|
Public Sub Method()
|
|
Dim MyObject As Object = Nothing
|
|
Console.WriteLine(MyObject.ToString) ' Noncompliant: 'MyObject' is always Nothing
|
|
End Sub
|
|
----
|
|
|
|
The parameter `Input` might be `Nothing` as suggested by the `if` condition:
|
|
|
|
[source,vbnet,diff-id=2,diff-type=noncompliant]
|
|
----
|
|
Public Sub Method(Input As Object)
|
|
If Input Is Nothing Then
|
|
' ...
|
|
End If
|
|
Console.WriteLine(Input.ToString) ' Noncompliant: 'Input' might be Nothing
|
|
End Sub
|
|
---- |