C2018-003 corrected use of MyActiveSection vs ActiveSection and added NULL checks

This commit is contained in:
2018-10-08 15:30:05 +00:00
parent b1e6d50716
commit 37fb880794
7 changed files with 85 additions and 73 deletions

View File

@@ -2099,8 +2099,8 @@ namespace Volian.Print.Library
supInfoGroups = new List<List<vlnParagraph>>();
foreach (vlnParagraph pg in vlnParagraph.ChildrenBelow)
{
SectionInfo supInfoSect = pg.MyItemInfo.MyActiveSection as SectionInfo;
if (supInfoSect.StepSectPageBreaksForSupInfo != null && supInfoSect.StepSectPageBreaksForSupInfo.Contains(pg.MyItemInfo.ItemID))
SectionInfo supInfoSect = (pg.MyItemInfo.ActiveSection != null) ? pg.MyItemInfo.ActiveSection as SectionInfo : null;
if (supInfoSect != null && supInfoSect.StepSectPageBreaksForSupInfo != null && supInfoSect.StepSectPageBreaksForSupInfo.Contains(pg.MyItemInfo.ItemID)) // C2018-003 fixed use of getting the active section
supInfoGroups.Add(new List<vlnParagraph>()); // add a grouping since a page break exists
if (supInfoGroups.Count == 0)
{