First time I have ever posted here so please bear with me. I have a class with a collection of classes in it;
When I use this;
I get the error "System.NullReferenceException: 'Object reference not set to an instance of an object.' MEP_Construction_Process_Tool.clsTViewActions.get_proTViewActionListCol returned Nothing." on the last line.
I am obviously doing something wrong and have searched for an answer but cannot find one.
What am I doing wrong?
Code:
Public Class clsTViewActions
'created 28/05/2020
Public valTViewActions As String 'Process root items
Public colTViewActionList As List(Of clsTViewActionComment)
Public Property proTViewActions() As String
Get
Return Me.valTViewActions
End Get
Set(ByVal value As String)
If Not (value = valTViewActions) Then
Me.valTViewActions = value
End If
End Set
End Property
Public Property proTViewActionListCol() As List(Of clsTViewActionComment)
Get
Return Me.colTViewActionList
End Get
Set(ByVal value As List(Of clsTViewActionComment))
End Set
End Property
End Class
Code:
TViewActionComment = New clsTViewActionComment
TViewActionComment.proTViewActionComment = "Level 1"
TViewActions = New clsTViewActions
TViewActions.proTViewActions = "Level 2"
TViewActions.proTViewActionListCol = New List(Of clsTViewActionComment)
TViewActions.proTViewActionListCol.Add(TViewActionComment)
I am obviously doing something wrong and have searched for an answer but cannot find one.
What am I doing wrong?