SonarLint VB: False S2589 Reported

  • Operating system: Windows 10
  • SonarLint plugin version:
  • Programming language you’re coding in: VB, Visual Studio 2022
  • Is connected mode used: No

I recently started getting S2589 warnings.

To prevent multiple events from being processed I use the following code. Because blnInEvent is static it is not False

Static blnInEvent As Boolean

If **blnInEvent** Then Return
blnInEvent = True

' Do Something Here

blnInEvent = False

Another S2589 is reported for this code where there is a potential for "objNode" to be null or nothing.

objNode = tvwShortcuts.SelectedNode

If **objNode Is Nothing** Then
    Do Something Here
End If