B2022-049: Copy/paste of enhanced procedure and bad links between source and enhanced

This commit is contained in:
2022-08-03 15:03:40 +00:00
parent f234174a51
commit b6d69fbd4c
8 changed files with 347 additions and 22 deletions

View File

@@ -1474,22 +1474,26 @@ namespace VEPROMS.CSLA.Library
// Find hls in enhanced in order to get its notes to set their config to
// point back to the new source's note itemid.
ItemInfo enhCtItem = null;
while (enhCtItem == null && enhIndxCt < enhHls.Cautions.Count)
// B2022-049: Copy/paste of enhanced procedure and bad links between source and enhanced. Null reference check
if (enhHls.Cautions != null)
{
ItemInfo enhTstCaut = enhHls.Cautions[enhIndxCt];
StepConfig enhTstCautCfg = enhTstCaut.MyConfig as StepConfig;
if (enhTstCautCfg.MyEnhancedDocuments.Count > 0)
while (enhCtItem == null && enhIndxCt < enhHls.Cautions.Count)
{
foreach (EnhancedDocument enhCt in enhTstCaut.GetMyEnhancedDocuments())
ItemInfo enhTstCaut = enhHls.Cautions[enhIndxCt];
StepConfig enhTstCautCfg = enhTstCaut.MyConfig as StepConfig;
if (enhTstCautCfg.MyEnhancedDocuments.Count > 0)
{
if (enhCt.Type == 0)
foreach (EnhancedDocument enhCt in enhTstCaut.GetMyEnhancedDocuments())
{
enhCtItem = enhTstCaut;
break;
if (enhCt.Type == 0)
{
enhCtItem = enhTstCaut;
break;
}
}
}
if (enhCtItem == null) enhIndxCt++;
}
if (enhCtItem == null) enhIndxCt++;
}
if (enhCtItem != null)
{