adds a couple of null checks.

This commit is contained in:
Shannon
2013-12-19 13:14:38 +11:00
parent 763ab26446
commit 67caf81a74
2 changed files with 2 additions and 2 deletions

View File

@@ -397,7 +397,7 @@ namespace umbraco.cms.businesslogic
{
var props = this.GenericProperties;
foreach (property.Property p in props)
if (p != null && !string.IsNullOrEmpty(p.Value.ToString()))
if (p != null && p.Value != null && string.IsNullOrEmpty(p.Value.ToString()) == false)
x.AppendChild(p.ToXml(xd));
// attributes

View File

@@ -1291,7 +1291,7 @@ namespace umbraco.cms.businesslogic.web
public override void XmlPopulate(XmlDocument xd, ref XmlNode x, bool Deep)
{
string urlName = this.Content.GetUrlSegment().ToLower();
foreach (Property p in GenericProperties.Where(p => p != null && !string.IsNullOrEmpty(p.Value.ToString())))
foreach (Property p in GenericProperties.Where(p => p != null && p.Value != null && string.IsNullOrEmpty(p.Value.ToString()) == false))
x.AppendChild(p.ToXml(xd));
// attributes