diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index 81ee712f..1887537a 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -264,13 +264,16 @@ namespace Volian.Print.Library private string Print(ProcedureInfo myProcedure, string pdfFolder) { _MyFoldoutReader = null; - foreach (SectionInfo mySection in myProcedure.Sections) + if (myProcedure.Sections != null) { - if (mySection.MyContent.Number.ToUpper() == "FOLDOUT") + foreach (SectionInfo mySection in myProcedure.Sections) { - _MyFoldoutSection = mySection; - string foldoutPdf = PrintProcedureOrFoldout(myProcedure, true, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\Foldout.pdf"); - _MyFoldoutReader = foldoutPdf != null ? new PdfReader(foldoutPdf) : null; + if (mySection.MyContent.Number.ToUpper() == "FOLDOUT") + { + _MyFoldoutSection = mySection; + string foldoutPdf = PrintProcedureOrFoldout(myProcedure, true, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\Foldout.pdf"); + _MyFoldoutReader = foldoutPdf != null ? new PdfReader(foldoutPdf) : null; + } } } OnStatusChanged("Print " + myProcedure.DisplayNumber, PromsPrinterStatusType.Start);