It's your "fault" in that that's how Or
is defined, so it's the behaviour you should expect:
In a Boolean comparison, the Or operator always evaluates both expressions, which could include making procedure calls. The OrElse Operator (Visual Basic) performs short-circuiting, which means that if expression1 is True, then expression2 is not evaluated.
But you don't have to endure it. You can use OrElse
to get short-circuiting behaviour.
So you probably want:
If (example Is Nothing OrElse Not example.Item = compare.Item) Then
'Proceed
End If
I can't say it reads terribly nicely, but it should work...