-Fix converting unmatched namespace prefixes in JSON to XML

This commit is contained in:
James Newton-King
2015-03-08 11:11:16 +13:00
parent 95e04ba96e
commit 0effb85a31
2 changed files with 39 additions and 1 deletions
@@ -1376,7 +1376,7 @@ namespace Newtonsoft.Json.Converters
string attributePrefix = MiscellaneousUtils.GetPrefix(nameValue.Key);
IXmlNode attribute = (!string.IsNullOrEmpty(attributePrefix))
? document.CreateAttribute(nameValue.Key, manager.LookupNamespace(attributePrefix), nameValue.Value)
? document.CreateAttribute(nameValue.Key, manager.LookupNamespace(attributePrefix) ?? string.Empty, nameValue.Value)
: document.CreateAttribute(nameValue.Key, nameValue.Value);
element.SetAttributeNode(attribute);