Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27417

VS 2010 [RESOLVED] NullReferenceException and I don't know why.

$
0
0
I am getting a nullreferenceexception when I try running this code below.

vbNET Code:
  1. Private _listOfItems As List(Of Item)
  2.  
  3.     ''' <summary>
  4.     ''' This will check for ItemAttachments and then add the item to a list.
  5.     ''' </summary>
  6.     ''' <param name="item">Item to check for attachments</param>
  7.     ''' <remarks></remarks>
  8.     Private Sub CheckForItemAttachments(ByVal item As Item)
  9.         If item.HasAttachments Then
  10.             _listOfItems.Add(item)' Errors right here with A first chance exception of type 'System.NullReferenceException' occurred in ISSvc2.exe
  11.  
  12.         End If
  13.     End Sub

Viewing all articles
Browse latest Browse all 27417

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>