LinkedList Breaks With Null Objects [1.30]

BlitzMax Forums/BlitzMax Bug Reports/LinkedList Breaks With Null Objects [1.30]

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

@Gabriel: modifying the TList.Count() method as below will clear the list of all Null references when List.Count() is called.
	Method Count()
		Local link:TLink=_head._succ,count
		While link<>_head
			If link._value = Null
				link.Remove()
			Else
				count:+1
			End If
			link=link._succ
		Wend
		Return count
	End Method



edit:Example code
SuperStrict
Global List:TList=New TList

Type TMyType
	Field x:Int = 0
End Type

List.AddFirst(Null)
List.AddFirst(New TMyType)
List.AddFirst(Null)
List.AddFirst(New TMyType)
List.AddFirst(Null)
list.AddFirst(New TMyType)

Print List.Count()

For Local O:Object=EachIn List
   Print "Here is an object we have found!"
Next