added a check for a null reference

This commit is contained in:
John Jenko 2012-12-07 18:54:55 +00:00
parent 414378e0f3
commit c52bda13f3
2 changed files with 4 additions and 3 deletions

View File

@ -284,7 +284,7 @@ namespace VEPROMS.CSLA.Library
public ItemInfo InsertSiblingBefore(string text, string number)
{
ItemInfo tmp = null;
if (FormatStepData.UseSmartTemplate || MyHLS.FormatStepData.UseSmartTemplate)
if (!IsSection && (FormatStepData.UseSmartTemplate || MyHLS.FormatStepData.UseSmartTemplate))
tmp = InsertSmartTemplateSteps(text, number, tmp, EAddpingPart.Before, (int)MyContent.Type);
else
tmp = NewItemInfoFetch(ItemID, EAddpingPart.Before, number, text, null, null, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID);
@ -410,7 +410,7 @@ namespace VEPROMS.CSLA.Library
public ItemInfo InsertSiblingAfter(string text, string number, int? type)
{
ItemInfo tmp = null;
if (FormatStepData.UseSmartTemplate || MyHLS.FormatStepData.UseSmartTemplate)
if (!IsSection &&(FormatStepData.UseSmartTemplate || MyHLS.FormatStepData.UseSmartTemplate))
tmp = InsertSmartTemplateSteps(text, number, tmp, EAddpingPart.After, (int)MyContent.Type);
else
tmp = NewItemInfoFetch(ItemID, EAddpingPart.After, number, text, type, null, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID);

View File

@ -57,7 +57,8 @@ namespace Volian.Controls.Library
set
{
_MyStepPanel.SelectedEditItem = _MyStepPanel.GetEditItem(value);
_MyStepPanel.SelectedEditItem.ItemSelect();
if (_MyStepPanel.SelectedEditItem != null)
_MyStepPanel.SelectedEditItem.ItemSelect();
if (!_MyStepPanel.ItemSelectionChangeShown) _MyStepPanel.OnItemSelectedChanged(this, new ItemSelectedChangedEventArgs(_MyStepPanel.SelectedEditItem));
}
}