In our code base there is a function which should return either an object or nothing.
The exact code is this :
Return Nothing
The calling method looks something like this
myObj = theClass.function()
if myObj <> nothing then // fails
Am I missing something in C# I would use an if not null check, why would this fail in VB.net, and how can I check the return val from the func is not nothing?
Thanks in advance
In order to compare references (and
Nothing) you need to useIsandIsNot, not=and<>.That is: