Code tweaks from PR review - also led to adding logging for Deserialization issues and therefore needing to mock the logger for the tests

This commit is contained in:
Jeavon
2019-11-13 12:07:11 +00:00
parent 10622cc430
commit 88f6ddeae4
3 changed files with 22 additions and 5 deletions

View File

@@ -177,9 +177,8 @@ namespace Umbraco.Web.Models.Mapping
target.Name = source.Values.ContainsKey("nodeName") ? source.Values["nodeName"] : "[no name]";
if (source.Values.ContainsKey(UmbracoExamineIndex.UmbracoFileFieldName))
if (source.Values.TryGetValue(UmbracoExamineIndex.UmbracoFileFieldName, out var umbracoFile))
{
var umbracoFile = source.Values[UmbracoExamineIndex.UmbracoFileFieldName];
if (umbracoFile != null)
{
target.Name = $"{target.Name} ({umbracoFile})";