From ad6108282889a6bf006c3a17a1b9b11125cea7d3 Mon Sep 17 00:00:00 2001 From: Kathy Date: Tue, 4 Aug 2020 12:16:38 +0000 Subject: [PATCH] B2020-103: crash on null reference when cancel from create new section --- PROMS/Volian.Controls.Library/vlnTreeView.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PROMS/Volian.Controls.Library/vlnTreeView.cs b/PROMS/Volian.Controls.Library/vlnTreeView.cs index 0360501e..58fcda94 100644 --- a/PROMS/Volian.Controls.Library/vlnTreeView.cs +++ b/PROMS/Volian.Controls.Library/vlnTreeView.cs @@ -2803,7 +2803,7 @@ namespace Volian.Controls.Library // B2020-087 the config for SubSection_Edit was sometimes set even when there wasn't any subsections, // so make sure it's cleared if there are no existing subsections SectionConfig sc = _LastItemInfo.MyConfig as SectionConfig; - if (sc.SubSection_Edit == "Y" && _LastItemInfo.Sections == null) + if (sc != null && sc.SubSection_Edit == "Y" && _LastItemInfo.Sections == null) { sc.SubSection_Edit = null; using (Section mysect = Section.Get(_LastItemInfo.ItemID)) @@ -3204,7 +3204,7 @@ namespace Volian.Controls.Library { // B2020-087 if we deleted the last sub section, then clear the SubSection_Edit in the parent's config SectionConfig sc = pii.MyConfig as SectionConfig; - if (sc.SubSection_Edit == "Y" && pii.Sections == null) + if (sc != null && sc.SubSection_Edit == "Y" && pii.Sections == null) // B2020-103: Added null check { sc.SubSection_Edit = null; using (Section mysect = Section.Get(pii.ItemID))