title: VB.NET Error - Null Reference Exception could occur at run time when the result is used
body: <p>Background: I wrote code that will output all the currently logged in User's Active Directory group names. I want the group name (ex: Acomp_user_BIG) via IdentityReference.Translate instead of the current user's SID's (ex: S-1-5-32-544) returned via IdentityReference.Value. </p>
  
  <p>Here is code that I used:</p>
  
  <pre><code>Public ReadOnly Property Groups As IdentityReferenceCollection
      Get
           Dim irc As IdentityReferenceCollection
           Dim ir As IdentityReference
           irc = WindowsIdentity.GetCurrent().Groups
  
           For Each ir In irc
                Dim account As IdentityReference = ir.Translate(GetType(NTAccount))
                Debug.WriteLine(account.Value)
           Next
  
      End Get
  End Property
  </code></pre>
  
  <p>Unfortunately, I get the error on the "End Get":</p>
  
  <pre><code>   Warning  1   Property 'Groups' doesn't return a value on all code paths. 
                  A null reference exception could occur at run time when the 
                  result is used. 
  </code></pre>
  
  <p>Any suggestions for fixing this error?</p>