Object reference not set to an instance of an obje
I have the following chunk of code:
private void PopulateGrids()
{
//Get project cache
List<ProjectEnterpriseCustomFieldContainer> list = EnterpriseCustomFieldsStorege.GetInstance().Projec tEnterpriseCustomFields[
new Guid(application.ActiveProject.GetServerProjectGui d())];
Dictionary<string, ProjectEnterpriseCustomFieldContainer> allFields = new Dictionary<string, ProjectEnterpriseCustomFieldContainer>();
list.ForEach(delegate(ProjectEnterpriseCustomField Container container) { allFields.Add(container.FieldName, container); });
List<ProjectEnterpriseCustomFieldContainer> listStartUp = GetBindingList(allFields, htStartUp);
List<ProjectEnterpriseCustomFieldContainer> listDelivery = GetBindingList(allFields, htDelivery);
List<ProjectEnterpriseCustomFieldContainer> listReference = GetBindingList(allFields, htReference);
List<ProjectEnterpriseCustomFieldContainer> listSPSS = GetBindingList(allFields, htSPSS);
if (origlistSPSS == null)
{
origlistSPSS.AddRange(listSPSS.GetRange(0, 23));
origlistStartUp = listStartUp;
origlistReference = listReference;
origlistDelivery = listDelivery;
}
}
I am getting an error "Object reference not set to an instance of an object" on the line origListSPSS.AddRange.
the list origList is declared as: List<ProjectEnterpriseCustomFieldContainer> origlistSPSS;
If anybody has any ideas that would be appreciated - I cannot see why I cannot add the elements to the list?
Thanks
GS
|