diff --git a/PROMS/VEPROMS.CSLA.Library/Format/vlnFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/vlnFormat.cs index 99bf96be..abc882c4 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/vlnFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/vlnFormat.cs @@ -295,7 +295,12 @@ namespace VEPROMS.CSLA.Library if (ll == null) { XmlNode xn = SelectSingleNode(xPath); - ll = new LazyLoad>(xn != null ? (Nullable)Enum.Parse(typeof(T), xn.InnerText) : null); + if (xn == null) + ll = new LazyLoad(null); + else if (xn.Value == "")// No value specified - Use zero value if it is defined - GetName returns a null if it is not defined + ll = new LazyLoad>(Enum.GetName(typeof(T), 0) != null ? (Nullable) Enum.Parse(typeof(T), "0") : null); + else + ll = new LazyLoad>((Nullable)Enum.Parse(typeof(T), xn.InnerText)); } return ll.Value; }