diff --git a/PROMS/DataLoader/Transitions.cs b/PROMS/DataLoader/Transitions.cs index df6b045d..c683103b 100644 --- a/PROMS/DataLoader/Transitions.cs +++ b/PROMS/DataLoader/Transitions.cs @@ -355,17 +355,19 @@ namespace DataLoader break; } } - - // For each transition that points to the A0, make it point to the proc. - // First, find all of them by getting transitions with the A0 (dummy - // transition record). Then update the to or range id in the transition - // record & then update the content/from part. - List transToChg = new List(); - List transRgChg = new List(); - TransitionInfoList til = TransitionInfoList.GetByToID(item.ItemID); - foreach (TransitionInfo ti in til) UpdateTranDataForA0(prc, ti.TransitionID, false); - til = TransitionInfoList.GetByRangeID(item.ItemID); - foreach (TransitionInfo tir in til) UpdateTranDataForA0(prc, tir.TransitionID, true); + if (prc != null) + { + // For each transition that points to the A0, make it point to the proc. + // First, find all of them by getting transitions with the A0 (dummy + // transition record). Then update the to or range id in the transition + // record & then update the content/from part. + List transToChg = new List(); + List transRgChg = new List(); + TransitionInfoList til = TransitionInfoList.GetByToID(item.ItemID); + foreach (TransitionInfo ti in til) UpdateTranDataForA0(prc, ti.TransitionID, false); + til = TransitionInfoList.GetByRangeID(item.ItemID); + foreach (TransitionInfo tir in til) UpdateTranDataForA0(prc, tir.TransitionID, true); + } } } foreach (string str in RemoveFromDicTrans)