From a629f6834b20fb202472b5c0795ef8e1760fcf41 Mon Sep 17 00:00:00 2001 From: John Jenko Date: Wed, 21 Aug 2024 11:37:37 -0400 Subject: [PATCH] B2024-061- Added a null reference check in the save annotation code. Need for when Admin deletes the annotation while a user modified the text of it --- .../Volian.Controls.Library/AnnotationDetails.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/PROMS/Volian.Controls.Library/AnnotationDetails.cs b/PROMS/Volian.Controls.Library/AnnotationDetails.cs index a6ed00e8..dca9ff95 100644 --- a/PROMS/Volian.Controls.Library/AnnotationDetails.cs +++ b/PROMS/Volian.Controls.Library/AnnotationDetails.cs @@ -674,12 +674,15 @@ namespace Volian.Controls.Library { using (Annotation annotation = CurrentAnnotation.Get()) { - annotation.RtfText = rtxbComment.Rtf; - annotation.SearchText = rtxbComment.Text; - annotation.MyAnnotationType = annotationType; - annotation.DTS = DateTime.Now; - annotation.UserID = Volian.Base.Library.VlnSettings.UserID; - annotation.Save(); + if (annotation != null) // B2024-061 check for null reference + { + annotation.RtfText = rtxbComment.Rtf; + annotation.SearchText = rtxbComment.Text; + annotation.MyAnnotationType = annotationType; + annotation.DTS = DateTime.Now; + annotation.UserID = Volian.Base.Library.VlnSettings.UserID; + annotation.Save(); + } } } }