diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs index fbff1e2e..52196c15 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs @@ -2135,6 +2135,7 @@ namespace VEPROMS.CSLA.Library return link.Contains("#Link:Transition"); } private static Regex regRefObj = new Regex(@"\#Link\:ReferencedObject:([0-9]*) ([0-9a-zA-Z]*) ([0-9]*)", RegexOptions.Singleline); + private static bool DidMsgBox = false; private static bool IsSetpointRO(string link, DocVersionInfo myDocVersion) { Match myMatch = regRefObj.Match(link); @@ -2143,7 +2144,17 @@ namespace VEPROMS.CSLA.Library int dbid = System.Convert.ToInt32(myMatch.Groups[2].Value.Substring(0, 4), 16); int rodbid = int.Parse(myMatch.Groups[3].Value); ROFstInfo myROFst = myDocVersion.GetROFst(rodbid); - return myROFst.IsSetpointDB(dbid, myDocVersion); + // B2016-267: Linking to enhanced background steps crashed if step had RO and if no RO path was set. Really problem + // is that ro path was not set - just so happened it was found during use of Linking to enhanced. + if (myROFst == null) + { + if (!DidMsgBox) // only put the message box out once. + { + DidMsgBox = true; + MessageBox.Show(string.Format("{0} does not have Referenced Object Path set.",myDocVersion.MyFolder.Name), "No RO Path Set", MessageBoxButtons.OK,MessageBoxIcon.Exclamation); + } + } + return myROFst==null?false:myROFst.IsSetpointDB(dbid, myDocVersion); } return false; }