From 75ec77fd49b43d398b16ead26e92c11f248c5b10 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 29 Mar 2017 16:51:15 +0000 Subject: [PATCH] B2017-065 Fixed null reference bug happening during a CopyStep / Replace Step of an EOP step that is linked to an Enhanced step --- PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs index de0057cf..bd0baaf3 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs @@ -544,8 +544,9 @@ namespace VEPROMS.CSLA.Library public static void CheckSourceDestinationType(int copyStartID, ItemInfo itemInfo) { ItemInfo cpyItem = ItemInfo.Get(copyStartID); - int? SourceType = cpyItem._MyContent.Type; - int? DestType = itemInfo._MyContent.Type; + // B2017-065 use MyContent instead of _Mycontent so that if null it will get the needed content + int? SourceType = cpyItem.MyContent.Type; + int? DestType = itemInfo.MyContent.Type; if (DestType >= 20000 && DestType != SourceType) { string msg = "The step you are copying TO is a different type than the step you are copying FROM.\n\nThe copied step will inherit the destination step type.\n\nOnce copied, the step type can be changed from the Tags tab on the Step Properties panel."; @@ -1278,7 +1279,7 @@ namespace VEPROMS.CSLA.Library // don't connect back, so find one that does based on Enhance HLS note list & // the notes' links back to source. ItemInfo enhNtItem = null; - while (enhNtItem == null && enhIndxNt < enhHls.Notes.Count) + while (enhNtItem == null && enhHls.Notes != null && enhIndxNt < enhHls.Notes.Count) // B2017-065 added a null check for Notes { ItemInfo enhTstNote = enhHls.Notes[enhIndxNt]; StepConfig enhTstNoteCfg = enhTstNote.MyConfig as StepConfig;