B2021-093 null reference check when looking for child RO values

This commit is contained in:
John Jenko 2021-08-24 14:01:40 +00:00
parent d6c42e144b
commit f69fd75759

View File

@ -304,13 +304,15 @@ namespace VEPROMS.CSLA.Library
public string GetParentChildROValue(rochild roc)
{
string roval = roc.value;
// B2021-093 Don't look for child RO values if "roval" is null
if (roval == null) return null;
// get the child (slave) information and set the rtnchld.value to the corresponding RO Value
int selChldIdx = MyDocVersionInfo.DocVersionConfig.SelectedSlave;
string childName = MyDocVersionInfo.DocVersionConfig.Unit_Name;
string aplString = roval;
string ChldValue = "";
// if the RO Value contains Parent/Child values, parse out default value and the child (slave or unit specific) value
while (roval.Contains("<APL DefaultVal="))
while (roval != null && roval.Contains("<APL DefaultVal="))
{
int startCVIdx = roval.IndexOf("<APL DefaultVal=");
int EndCVidx = roval.IndexOf(" /APL>", startCVIdx);