From 69fec106f704f514037d91eace652e066516d42f Mon Sep 17 00:00:00 2001 From: Kathy Date: Thu, 11 May 2023 13:12:23 +0000 Subject: [PATCH] B2023-049: Null reference crash on Paste Before --- PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs index d29c4062..6b469f29 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs @@ -597,6 +597,13 @@ namespace VEPROMS.CSLA.Library public static bool CheckSourceDestinationType(int copyStartID, ItemInfo itemInfo) { ItemInfo cpyItem = ItemInfo.Get(copyStartID); + + // B2023-049: crash when copied step is no longer available (may have been deleted in previous operation) + if (cpyItem == null) + { + DialogResult msgBoxResult = FlexibleMessageBox.Show("The step you are pasting no longer exists - it may have been deleted as part of a previous operation.", "Paste Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return false; + } // 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;