Added null check on raw JSON to prevent null reference error deserializing the grid

(cherry picked from commit bcea0f645a)
This commit is contained in:
mattchanner
2020-04-01 13:12:05 +01:00
committed by Sebastiaan Janssen
parent 5f5773b0c0
commit d0eee32f1d

View File

@@ -165,6 +165,10 @@ namespace Umbraco.Web.PropertyEditors
public IEnumerable<UmbracoEntityReference> GetReferences(object value)
{
var rawJson = value == null ? string.Empty : value is string str ? str : value.ToString();
if (rawJson.IsNullOrWhiteSpace())
yield break;
DeserializeGridValue(rawJson, out var richTextEditorValues, out var mediaValues);
foreach (var umbracoEntityReference in richTextEditorValues.SelectMany(x =>