diff --git a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs index f52c7df1..22cb52c4 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs @@ -470,7 +470,17 @@ namespace VEPROMS.CSLA.Library rochild roc = GetRoChild12(ROID); if (roc.value == null) roc = GetRoChild(ROID); - sb.Append(roc.title.Replace(roc.appid,"").Replace(roc.value,"").Trim()); + // B2020-125: View of Consistency check report displaying error message and crashing. And also in 'else' check for null + if (roc.ID == -1) + sb.Append("Could not find RO data"); + else + { + string tmp = roc.title; + if (tmp == null) tmp = ""; + if (roc.appid != null) tmp = tmp.Replace(roc.appid, ""); + if (roc.value != null) tmp = tmp.Replace(roc.value, ""); + sb.Append(tmp.Trim()); + } do { string parent = ROID.Substring(0, 4) + string.Format("{0:X8}", roc.ParentID); diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/RevisionInfoExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/RevisionInfoExt.cs index aa2d227a..e7ba44a6 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/RevisionInfoExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/RevisionInfoExt.cs @@ -83,10 +83,17 @@ namespace VEPROMS.CSLA.Library foreach (ROCheck roc in MyDifferences.ROConsistency.MyROChecks) { ROFSTLookup.rochild rocc = lu.GetRoChild12(roc.ROID); - if(rocc.type == 1) - sb.Append(string.Format(" {0} - Old Value: {1} - New Value: {2}\r\n", lu.GetROTitle(roc.ROID), roc.OldROValue, roc.ROValue)); + if (rocc.ID == -1) // B2020-125: View of Consistency check report displaying error message and crashing. + { + sb.Append(string.Format(" {0}\r\n", lu.GetROTitle(roc.ROID))); + } else - sb.Append(string.Format(" {0} - Value has changed.\r\n", lu.GetROTitle(roc.ROID))); + { + if (rocc.type == 1) + sb.Append(string.Format(" {0} - Old Value: {1} - New Value: {2}\r\n", lu.GetROTitle(roc.ROID), roc.OldROValue, roc.ROValue)); + else + sb.Append(string.Format(" {0} - Value has changed.\r\n", lu.GetROTitle(roc.ROID))); + } } } //jcb