diff --git a/src/Umbraco.Core/Models/ContentBase.cs b/src/Umbraco.Core/Models/ContentBase.cs index 81808473da..32eec7f284 100644 --- a/src/Umbraco.Core/Models/ContentBase.cs +++ b/src/Umbraco.Core/Models/ContentBase.cs @@ -264,17 +264,7 @@ namespace Umbraco.Core.Models /// Value as an public virtual object GetValue(string propertyTypeAlias) { - try - { - return Properties[propertyTypeAlias].Value; - } - catch (KeyNotFoundException ex) - { - var message = string.Format("Cannot find the property with alias '{0}' for the node named '{1}' with id '{2} that uses the document type alias '{3}'", - propertyTypeAlias, this.Name, this.Id, this.ContentTypeBase.Alias); - - throw new Exception(message, ex); - } + return Properties.Contains(propertyTypeAlias) ? Properties[propertyTypeAlias].Value : null; } /// @@ -285,18 +275,13 @@ namespace Umbraco.Core.Models /// Value as a public virtual TPassType GetValue(string propertyTypeAlias) { - try + if (Properties.Contains(propertyTypeAlias) == false) { - var convertAttempt = Properties[propertyTypeAlias].Value.TryConvertTo(); - return convertAttempt.Success ? convertAttempt.Result : default(TPassType); - } - catch (KeyNotFoundException ex) - { - var message = string.Format("Cannot find the property with alias '{0}' for the node named '{1}' with id '{2} that uses the document type alias '{3}'", - propertyTypeAlias, this.Name, this.Id, this.ContentTypeBase.Alias); + return default(TPassType); + } - throw new Exception(message, ex); - } + var convertAttempt = Properties[propertyTypeAlias].Value.TryConvertTo(); + return convertAttempt.Success ? convertAttempt.Result : default(TPassType); } ///