Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NullReferenceException when adding item to generic list
#2
Your problem lies within this line:

[code2=vbnet]Dim listIndexes As List(Of Integer) = Nothing[/code2]

So when you try to add items to the listIndexes variable, you are actually trying to add items to Nothing, hence your error. Thus, you need to initialize the list before putting anything into it. Try changing it to something like:

[code2=vbnet]Dim listIndexes As List(Of Integer) = New List(Of Integer)[/code2]
My Blog | My Setup | My Videos | Have a wonderful day.


Messages In This Thread
Re: NullReferenceException when adding item to generic list - by brandonio21_phpbb3_import2 - 06-17-2014, 12:16 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Search ListBox + Convert ListBox.item to string brco900033 3 14,573 09-13-2012, 03:03 PM
Last Post: brandonio21
  Change full row select back colour or list view Bradley 3 21,265 05-23-2012, 06:54 PM
Last Post: brandonio21

Forum Jump:


Users browsing this thread: 1 Guest(s)