From 67caf81a74bbb697fc766558e80e78298030521d Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 19 Dec 2013 13:14:38 +1100 Subject: [PATCH] adds a couple of null checks. --- src/umbraco.cms/businesslogic/Content.cs | 2 +- src/umbraco.cms/businesslogic/web/Document.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/umbraco.cms/businesslogic/Content.cs b/src/umbraco.cms/businesslogic/Content.cs index 080e6a2665..f2e52a1287 100644 --- a/src/umbraco.cms/businesslogic/Content.cs +++ b/src/umbraco.cms/businesslogic/Content.cs @@ -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 diff --git a/src/umbraco.cms/businesslogic/web/Document.cs b/src/umbraco.cms/businesslogic/web/Document.cs index f07ea160a5..b95a8402f7 100644 --- a/src/umbraco.cms/businesslogic/web/Document.cs +++ b/src/umbraco.cms/businesslogic/web/Document.cs @@ -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