B2020-035 Added a NULL reference check to prevent PROMS from crashing during print.

This commit is contained in:
John Jenko 2020-03-13 13:48:15 +00:00
parent d0c27fcb43
commit ae1396bf5a

View File

@ -1008,7 +1008,8 @@ namespace Volian.Print.Library
// B2020-032 put in for Barakah EOPs 1T4-OP-EOP-XX-0100 Attachement 32 step 1.2.2a where a table was printing on a page by itself.
// The following logic will walk up to each parent level to see try and get as many parent step levels on the same page
// as the Table.
if (paraBreak.MyItemInfo.IsTable && paraBreak.MyParent.YSize < (yPageSize - (myTopMsgSpace + SixLinesPerInch) - myBottomMsgSpace))
// B2020-035 added a null reference check to fix printing crash
if (paraBreak != null && paraBreak.MyItemInfo.IsTable && paraBreak.MyParent.YSize < (yPageSize - (myTopMsgSpace + SixLinesPerInch) - myBottomMsgSpace))
{
vlnParagraph tparent = paraBreak.MyParent;
while (!tparent.MyItemInfo.IsHigh && tparent.MyParent.YSize < (yPageSize - (myTopMsgSpace + SixLinesPerInch) - myBottomMsgSpace))
@ -1241,10 +1242,12 @@ namespace Volian.Print.Library
// B2018-024: Added the 'DidPreferredPageBreak', don't do the compressed code if a preferred page break exists on the step.
if (!DidPreferredPageBreak && (MyItemInfo.IsStep && !MyItemInfo.FormatStepData.PageBreakOnStep) && MyItemInfo.ActiveFormat.MyStepSectionLayoutData.PartialStepCompression && onNewPage) // ySpaceOnNextPage1 == ySpaceOnCurPage+myBottomMsgSpace)
{
float ySpaceAt7LPI = ((ySpaceOnCurPage - accountForCalvertAlarmConditionResponseFooter) * SixLinesPerInch / _SevenLinesPerInch) - _SevenLinesPerInch;
float ySpaceAt7LPI = ((ySpaceOnCurPage - accountForCalvertAlarmConditionResponseFooter) * SixLinesPerInch / _SevenLinesPerInch) - _SevenLinesPerInch;
vlnParagraph paraBreak7 = FindPageBreak(yStart, ySpaceAt7LPI, yLowerLimit,
myList, lastBreak, yPageSize - (myTopMsgSpace + SixLinesPerInch) - myBottomMsgSpace,
myBottomMsgSpace, MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[40].ContinueOnly);
//if (paraBreak7 != null && paraBreak7.MyItemInfo.InList(181056)) // to debug Farley bug B2020-027
// Console.WriteLine("X");
if (paraBreak7 != null && paraBreak7.YOffset > paraBreak.YOffset && paraBreak.MyItemInfo.StepLevel >= paraBreak7.MyItemInfo.StepLevel)
{
paraBreak = paraBreak7;