diff --git a/PROMS/VEPROMS.CSLA.Library/Config/ProcConfig.cs b/PROMS/VEPROMS.CSLA.Library/Config/ProcConfig.cs index 20ec0d0a..1b2fd9b4 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/ProcConfig.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/ProcConfig.cs @@ -64,7 +64,8 @@ namespace VEPROMS.CSLA.Library if (retval != string.Empty) return retval; proc = (ProcedureInfo)proc.ActiveParent; } - DocVersionInfo docVersion = (DocVersionInfo)proc.ActiveParent; + DocVersionInfo docVersion = proc.ActiveParent as DocVersionInfo; + if (docVersion == null) return string.Empty; retval = docVersion.DocVersionConfig.GetValue(args.Group, args.Item); if (retval != string.Empty) return retval; for (FolderInfo folder = docVersion.MyFolder; folder != null; folder = folder.MyParent) diff --git a/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs b/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs index baef868f..28918971 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs @@ -74,7 +74,8 @@ namespace VEPROMS.CSLA.Library if (retval != string.Empty) return retval; proc = (ProcedureInfo)proc.ActiveParent; } - DocVersionInfo docVersion = (DocVersionInfo)proc.ActiveParent; + DocVersionInfo docVersion = proc.ActiveParent as DocVersionInfo; + if (docVersion == null) return string.Empty; retval = docVersion.DocVersionConfig.GetValue(args.Group, args.Item); if (retval != string.Empty) return retval; for (FolderInfo folder = docVersion.MyFolder; folder != null; folder = folder.MyParent)