Visual Basic .NET Language Empty Return


Example

Function TestFunction() As TestClass
    Return Nothing
End Function

BAD CODE

TestFunction().TestMethod()

GOOD CODE

Dim x = TestFunction()
If x IsNot Nothing Then x.TestMethod()
14.0

Null Conditional Operator

TestFunction()?.TestMethod()