假设我有一个结构
Structure Test
Public Names as List(Of Strings)
End Structure
我收到错误
A first chance exception of type 'System.NullReferenceException' occurred
所以我进入了代码,每次我向 Names 添加字符串时都会出错
例子:
Dim a as new Test
Dim b = 1
While b < 2
if b = 1 then
a.add("Cheese")
End If
b += 1
End While
一个错误会抛出a.add("Cheese")
有任何想法吗?