Improved logic for bug fix B2018-043. Added a NULL reference check in the logic that detects an infinite loop while checking for invalid transitions

This commit is contained in:
John Jenko 2018-03-08 14:33:20 +00:00
parent 7164ae98ef
commit 8b864b3d44

View File

@ -743,16 +743,19 @@ namespace VEPROMS.CSLA.Library
{
bool hasAnnotation = false;
AnnotationType myType = AnnotationType.GetByNameOrCreate("Link Converted To Text");
foreach (AnnotationInfo anot in itemInfo.ItemAnnotations)
if (itemInfo.ItemAnnotations != null)
{
if (anot.TypeID == myType.TypeID && anot.SearchText == "Invalid Transition Format")
hasAnnotation = true;
}
if (!hasAnnotation)
{
using (Item myItem = itemInfo.Get())
foreach (AnnotationInfo anot in itemInfo.ItemAnnotations)
{
Annotation.MakeAnnotation(myItem, myType, "", "Invalid Transition Format", null);
if (anot.TypeID == myType.TypeID && anot.SearchText == "Invalid Transition Format")
hasAnnotation = true;
}
if (!hasAnnotation)
{
using (Item myItem = itemInfo.Get())
{
Annotation.MakeAnnotation(myItem, myType, "", "Invalid Transition Format", null);
}
}
}
break;