diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs index 03e19837..4fbb6732 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs @@ -451,6 +451,10 @@ namespace VEPROMS.CSLA.Library { string val = lookup.GetROValueByAccPagID(sel.Text, spPrefix, igPrefix); int? type = lookup.GetROTypeByAccPagID(sel.Text, spPrefix, igPrefix); + // if type is null, then set type to zero so that InsertROValue will put in "RO Not Found" for the value + if (type == null) + type = 0; + if ((int)type == 8) // Image { //Console.WriteLine("Image: {0} - {1}", sect.MyContent.Number, sect.MyContent.Text); @@ -523,8 +527,10 @@ namespace VEPROMS.CSLA.Library } else { - val = val.Replace("`", "\xB0"); + if (val != null) + val = val.Replace("`", "\xB0"); //AddInfo("\tRO Found {0} = '{1}'", sel.Text, val); + // if val is null, then InsertROValue will put in "RO Not Found" for the value InsertROValue(sel, val, sect.ActiveFormat.PlantFormat.FormatData.ROData.UpRoIfPrevUpper); } sel = FindRO();