Fixes U4-1553 - YSOD when umbracoUrlName value is null

This commit is contained in:
Sebastiaan Janssen
2013-01-26 15:50:53 -01:00
parent 59c844eb8f
commit a11d924736
2 changed files with 4 additions and 2 deletions

View File

@@ -405,7 +405,8 @@ namespace Umbraco.Core.Models
xml.Add(property.ToXml());
//Check for umbracoUrlName convention
if (property.Alias == "umbracoUrlName" && property.Value.ToString().Trim() != string.Empty)
if (property.Alias == "umbracoUrlName" && property.Value != null &&
property.Value.ToString().Trim() != string.Empty)
xml.SetAttributeValue("urlName", property.Value);
}

View File

@@ -1237,7 +1237,8 @@ namespace umbraco.cms.businesslogic.web
if (p != null)
{
x.AppendChild(p.ToXml(xd));
if (p.PropertyType.Alias == "umbracoUrlName" && p.Value.ToString().Trim() != string.Empty)
if (p.PropertyType.Alias == "umbracoUrlName" && p.Value != null
&& p.Value.ToString().Trim() != string.Empty)
urlName = p.Value.ToString();
}