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

This commit is contained in:
mattchanner
2020-04-01 13:12:05 +01:00
committed by Sebastiaan Janssen
parent 9f7c44c64e
commit bcea0f645a
@@ -192,6 +192,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 =>