diff --git a/PROMS/DataLoader/Sections.cs b/PROMS/DataLoader/Sections.cs index 03bbd5d3..3c4bf42f 100644 --- a/PROMS/DataLoader/Sections.cs +++ b/PROMS/DataLoader/Sections.cs @@ -559,7 +559,16 @@ namespace DataLoader ci.AddItem("Section", "NumPages", sequence.Substring(3, 1)); // see if it's a libdoc too - string thekey = procnum.PadRight(20) + step.Substring(0, 1).PadRight(10); + string mystep = null; + try + { + mystep = dr["Step"].ToString(); + } + catch (Exception ex) + { + Console.WriteLine("testing - error = {0}", ex.Message); + } + string thekey = procnum.PadRight(20) + ((mystep!=null)?mystep.Substring(0,1).PadRight(10):step.Substring(0, 1).PadRight(10)); if (dicLibDocRef.ContainsKey(thekey)) { // if it is a library document, see if the section record has already been