From a8bf881ae1967ddb85b723d6b25bfebda354c8d8 Mon Sep 17 00:00:00 2001 From: "ksykora@ksykora-Win7" Date: Wed, 21 Nov 2012 07:53:29 -0100 Subject: [PATCH] * Fixed an umbraco bug where the macro editor, if it tried to enumerate over a property whose value was null, would throw a null reference exception instead of just ignoring the property. --- src/Umbraco.Web/umbraco.presentation/macro.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/umbraco.presentation/macro.cs b/src/Umbraco.Web/umbraco.presentation/macro.cs index 4e492b0b0e..6e26718514 100644 --- a/src/Umbraco.Web/umbraco.presentation/macro.cs +++ b/src/Umbraco.Web/umbraco.presentation/macro.cs @@ -1496,7 +1496,7 @@ namespace umbraco IDictionaryEnumerator ide = attributes.GetEnumerator(); while (ide.MoveNext()) { - div += string.Format("umb_{0}=\"{1}\" ", ide.Key, encodeMacroAttribute(ide.Value.ToString())); + div += string.Format("umb_{0}=\"{1}\" ", ide.Key, encodeMacroAttribute((ide.Value ?? string.Empty).ToString())); } div += "ismacro=\"true\" onresizestart=\"return false;\" umbVersionId=\"" + versionId + @@ -1559,7 +1559,7 @@ namespace umbraco string querystring = "umbPageId=" + PageID + "&umbVersionId=" + PageVersion; IDictionaryEnumerator ide = attributes.GetEnumerator(); while (ide.MoveNext()) - querystring += "&umb_" + ide.Key + "=" + HttpContext.Current.Server.UrlEncode(ide.Value.ToString()); + querystring += "&umb_" + ide.Key + "=" + HttpContext.Current.Server.UrlEncode((ide.Value ?? string.Empty).ToString())); // Create a new 'HttpWebRequest' Object to the mentioned URL. string retVal = string.Empty;