From 003ce41d6b75263e076fd5ce8b9dcd4d36163783 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 12 Dec 2014 19:15:54 +0000 Subject: [PATCH] Added a null reference check to the insert before function --- PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs index 694be663..ee38ff3f 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs @@ -288,7 +288,7 @@ namespace VEPROMS.CSLA.Library public ItemInfo InsertSiblingBefore(string text, string number,int? type) { ItemInfo tmp = null; - if (!IsSection && (FormatStepData.UseSmartTemplate || MyHLS.FormatStepData.UseSmartTemplate || FormatStepData.UseOldTemplate)) + if (!IsSection && (FormatStepData.UseSmartTemplate || (MyHLS!=null && MyHLS.FormatStepData.UseSmartTemplate) || FormatStepData.UseOldTemplate)) tmp = InsertSmartTemplateSteps(text, number, tmp, EAddpingPart.Before, (int)MyContent.Type); if (tmp == null) tmp = NewItemInfoFetch(ItemID, EAddpingPart.Before, number, text, type, null, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID);