I am trying to remove the null values from a list of planes, and output the clean list of planes.

Sub RunScript(ByVal x As List(Of OnPlane))
Dim CleanList As New List (Of OnPlane)
Dim i As Integer
For i = 0 To x.Count() – 1
If x(i) = Nothing
Return
End If
CleanList.Add(x(i))
Next
A = CleanList
End Sub
Tags: