大家看看,这段程序为什么会引发空引用异常
private void menageNormalClientList(){
BankClient people = new BankClient();
while (true)
{
if (normalBankClientList.Count > 0)
{
people = normalBankClientList[0];
foreach (IBankWindow bw in bankWindowList)
{
if (!((BankWindow)bw).HasBankClient && ((BankWindow)bw).BankType == BankType.普通)
{
thread = new Thread(bw.DoSomething);
thread.Start(people);
((BankWindow)bw).HasBankClient = true;
normalBankClientList.Remove(people);
break;
}
}
}
}
}
people会引发空引用异常,我看了很久都不知道原因