From a413025fcd0f1c5c87bb0f8fc4bf13125d1d5b5e Mon Sep 17 00:00:00 2001 From: Kathy Date: Tue, 15 Aug 2017 15:22:20 +0000 Subject: [PATCH] B2017-174: Fix crash when linking (Enhanced) a new note (added a null reference check) when first in list with others below it. --- 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 ad9630b4..5e1055b3 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs @@ -1613,7 +1613,7 @@ namespace VEPROMS.CSLA.Library { ItemInfo exEnh = ItemInfo.Get(edSource.ItemID); int enhType = (int)MyContent.Type; - if (iiCur.MyContent.Type == MyContent.Type) // B2017-134 the enhanced section was being created with the wrong document type creating new enhanced section from EOP (byron data) + if (iiCur != null && iiCur.MyContent.Type == MyContent.Type) // B2017-134 the enhanced section was being created with the wrong document type creating new enhanced section from EOP (byron data) (B2017-174: added null check) enhType = (int)exEnh.MyContent.Type; if (exEnh.IsStep) newEnh = exEnh.InsertEnhancedSteps(MyContent.Text, null, addtype, enhType, edSource.Type, this.ItemID);