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

This commit is contained in:
John Jenko 2024-08-21 11:37:37 -04:00
parent bf5337cf63
commit a629f6834b

View File

@ -674,12 +674,15 @@ namespace Volian.Controls.Library
{ {
using (Annotation annotation = CurrentAnnotation.Get()) using (Annotation annotation = CurrentAnnotation.Get())
{ {
annotation.RtfText = rtxbComment.Rtf; if (annotation != null) // B2024-061 check for null reference
annotation.SearchText = rtxbComment.Text; {
annotation.MyAnnotationType = annotationType; annotation.RtfText = rtxbComment.Rtf;
annotation.DTS = DateTime.Now; annotation.SearchText = rtxbComment.Text;
annotation.UserID = Volian.Base.Library.VlnSettings.UserID; annotation.MyAnnotationType = annotationType;
annotation.Save(); annotation.DTS = DateTime.Now;
annotation.UserID = Volian.Base.Library.VlnSettings.UserID;
annotation.Save();
}
} }
} }
} }