Adds safety check of Udi.TryParse
This commit is contained in:
@@ -41,7 +41,8 @@ namespace Umbraco.Web.PropertyEditors
|
||||
|
||||
if (string.IsNullOrEmpty(asString)) yield break;
|
||||
|
||||
yield return new UmbracoEntityReference(Udi.Parse(asString));
|
||||
if (Udi.TryParse(asString, out var udi))
|
||||
yield return new UmbracoEntityReference(udi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,8 @@ namespace Umbraco.Web.PropertyEditors
|
||||
|
||||
if (string.IsNullOrEmpty(asString)) yield break;
|
||||
|
||||
yield return new UmbracoEntityReference(Udi.Parse(asString));
|
||||
if (Udi.TryParse(asString, out var udi))
|
||||
yield return new UmbracoEntityReference(udi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,8 @@ namespace Umbraco.Web.PropertyEditors
|
||||
var udiPaths = asString.Split(',');
|
||||
foreach (var udiPath in udiPaths)
|
||||
{
|
||||
yield return new UmbracoEntityReference(Udi.Parse(udiPath));
|
||||
if (Udi.TryParse(udiPath, out var udi))
|
||||
yield return new UmbracoEntityReference(udi);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace Umbraco.Web.PropertyEditors
|
||||
|
||||
if (string.IsNullOrEmpty(asString)) yield break;
|
||||
|
||||
var links = JsonConvert.DeserializeObject<List<MultiUrlPickerValueEditor.LinkDto>>(asString);
|
||||
var links = JsonConvert.DeserializeObject<List<LinkDto>>(asString);
|
||||
foreach (var link in links)
|
||||
{
|
||||
if (link.Udi != null) // Links can be absolute links without a Udi
|
||||
|
||||
Reference in New Issue
Block a user