B2020-004: Enhanced flag ‘allowmods’ caused crash on open of non-enhanced procedure after version properties change

This commit is contained in:
2020-01-14 15:04:46 +00:00
parent 213e7b297e
commit d1fba22cc3
2 changed files with 8 additions and 3 deletions

View File

@@ -16,9 +16,12 @@ namespace VEPROMS.CSLA.Library
}
public static DVEnhancedDocuments Load(XMLProperties _Xp)
{
DVEnhancedDocuments eds = new DVEnhancedDocuments();
DVEnhancedDocuments eds = null;
foreach (XmlNode xn in _Xp.XmlContents.SelectNodes("//Enhanced"))
{
XmlAttribute xa = xn.Attributes["VersionID"];
if (xa == null) return null; // B2020-004: if an enhanced node exists but has no version data, return null.
if (eds == null) eds = new DVEnhancedDocuments();
int dvid = int.Parse(xn.Attributes["VersionID"].Value);
DocVersionInfo dvi = DocVersionInfo.Get(dvid);
if (dvi != null)