From 32ddfbbce031ade1b9949f933c8a2be7cb87374e Mon Sep 17 00:00:00 2001 From: Rich Date: Thu, 6 Nov 2014 02:48:50 +0000 Subject: [PATCH] Fixed logic to keep code from crashing. --- PROMS/Volian.Controls.Library/DisplaySearch.cs | 2 +- PROMS/Volian.Print.Library/vlnParagraph.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplaySearch.cs b/PROMS/Volian.Controls.Library/DisplaySearch.cs index e34159ac..f30d9357 100644 --- a/PROMS/Volian.Controls.Library/DisplaySearch.cs +++ b/PROMS/Volian.Controls.Library/DisplaySearch.cs @@ -1641,7 +1641,7 @@ namespace Volian.Controls.Library foreach (ItemInfo myItem in myList) { sb.Append(string.Format("\r\n\"{0}\"\t\"{1}\"\t\"{2}\"\t\"{3}\"", myItem.ShortPath, myItem.ToolTip, - myItem.DisplayText, !myItem.IsSection && !myItem.IsHigh ? myItem.MyHLS.DisplayText : "")); + myItem.DisplayText, !myItem.IsSection && !myItem.IsHigh ? (myItem.MyHLS == null ? "" : myItem.MyHLS.DisplayText) : "")); if (myItem.ItemAnnotationCount > 0) foreach (AnnotationInfo myAnnotation in myItem.ItemAnnotations) sb.Append(string.Format("\t\"{0}\"", myAnnotation.SearchText)); diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 282724b3..fab4db73 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -2707,7 +2707,7 @@ namespace Volian.Print.Library && !MyItemInfo.MyDocStyle.CancelSectTitle && !MyItemInfo.MyDocStyle.SpecialStepsFoldout) // In Checklist: I don't have children or if I have children the first child doesn't alignwithparent. - || (!itemInfo.IsStepSection && itemInfo.MyHLS.FormatStepData.UseSmartTemplate + || (!itemInfo.IsStepSection && itemInfo.MyHLS != null && itemInfo.MyHLS.FormatStepData.UseSmartTemplate && ((itemInfo.Steps == null || itemInfo.Steps.Count == 0) || !itemInfo.Steps[0].FormatStepData.StepLayoutData.AlignWithParentTab))) {