B2021-033: crash on copy/paste replace of figure

This commit is contained in:
Kathy Ruffing 2021-03-29 13:21:37 +00:00
parent 380dd2ceac
commit 1171a51d00

View File

@ -543,12 +543,15 @@ namespace VEPROMS.CSLA.Library
private static int GetMaxSubStepLevel(ItemInfo parent)
{
int maxStepLevel = parent.StepLevel-1; // subtract one to account for HLS - we want the sub-step level
if (parent.Steps != null) // B2021-033: check for null
{
foreach (ItemInfo kid in parent.Steps)
{
if (kid.Steps != null)
maxStepLevel = Math.Max(maxStepLevel, GetMaxSubStepLevel(kid));
else
maxStepLevel = Math.Max(maxStepLevel,kid.StepLevel-1); // subtract one to account for HLS because we are counting only sub-step levels
maxStepLevel = Math.Max(maxStepLevel, kid.StepLevel - 1); // subtract one to account for HLS because we are counting only sub-step levels
}
}
return maxStepLevel;
}