Added a null reference check to the insert before function

This commit is contained in:
John Jenko 2014-12-12 19:15:54 +00:00
parent 763223fdd0
commit 003ce41d6b

View File

@ -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);