From 581c437861cddaa31dcea68c2a44dba038b87318 Mon Sep 17 00:00:00 2001 From: Rich Date: Mon, 13 Jan 2014 16:05:46 +0000 Subject: [PATCH] If running in Batch mode for automatic print testing, don't stop on a fatal error. Fixed a null reference error. If box is null don't try to update it's properties. --- PROMS/VEPROMS User Interface/Program.cs | 3 ++- PROMS/Volian.Print.Library/vlnParagraph.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/PROMS/VEPROMS User Interface/Program.cs b/PROMS/VEPROMS User Interface/Program.cs index 811046c4..e07fe515 100644 --- a/PROMS/VEPROMS User Interface/Program.cs +++ b/PROMS/VEPROMS User Interface/Program.cs @@ -62,7 +62,8 @@ namespace VEPROMS dpath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\ErrorLog.txt"; _log.Error("Proms Main ThreadException", e.Exception); string msg = string.Format("An error has occurred so the program will terminate. Please send the error log, {0}, to Volian.",dpath); - MessageBox.Show(msg); + if(!System.Environment.CommandLine.Contains("/P=")) + MessageBox.Show(msg); Application.Exit(); } } diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 7c1f4ac9..f3c4c6fe 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -226,7 +226,7 @@ namespace Volian.Print.Library // increment the y offset if not doing the ComponentTableFormat else if (!para.UseTemplateKeepOnCurLine(childItemInfo)) yoff = para.YBottomMost; - if (childItemInfo.FormatStepData != null && childItemInfo.FormatStepData.BoxIt) + if (box != null && childItemInfo.FormatStepData != null && childItemInfo.FormatStepData.BoxIt) { box.Height = yoff - box.YOffset - (1.1F * vlnPrintObject.SixLinesPerInch); box = null; // if doing boxed steps, only do single sibling at a time.