Merge pull request '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' (#394) from B2024-061 into Development

null reference check added to the code, tested locally before uploading
This commit is contained in:
John Jenko 2024-08-21 11:45:10 -04:00
commit 218a2c17a2

View File

@ -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();
}
}
}
}