diff --git a/src/Umbraco.Core/Deploy/IDataTypeConfigurationConnector.cs b/src/Umbraco.Core/Deploy/IDataTypeConfigurationConnector.cs
index 548a6d80f1..87a00e7969 100644
--- a/src/Umbraco.Core/Deploy/IDataTypeConfigurationConnector.cs
+++ b/src/Umbraco.Core/Deploy/IDataTypeConfigurationConnector.cs
@@ -22,13 +22,13 @@ namespace Umbraco.Cms.Core.Deploy
///
/// The datatype.
/// The dependencies.
- string ToArtifact(IDataType dataType, ICollection dependencies);
+ string? ToArtifact(IDataType dataType, ICollection dependencies);
///
/// Gets the actual datatype configuration corresponding to the artifact configuration.
///
/// The datatype.
/// The artifact configuration.
- object FromArtifact(IDataType dataType, string configuration);
+ object? FromArtifact(IDataType dataType, string? configuration);
}
}
diff --git a/src/Umbraco.Infrastructure/Deploy/IGridCellValueConnector.cs b/src/Umbraco.Infrastructure/Deploy/IGridCellValueConnector.cs
index 40c0b98474..94dabf7b4f 100644
--- a/src/Umbraco.Infrastructure/Deploy/IGridCellValueConnector.cs
+++ b/src/Umbraco.Infrastructure/Deploy/IGridCellValueConnector.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
using Umbraco.Cms.Core.Models;
namespace Umbraco.Cms.Core.Deploy
@@ -25,7 +25,7 @@ namespace Umbraco.Cms.Core.Deploy
/// The dependencies of the property.
/// The grid cell value to be deployed.
/// Note that
- string GetValue(GridValue.GridControl gridControl, ICollection dependencies);
+ string? GetValue(GridValue.GridControl gridControl, ICollection dependencies);
///
/// Allows you to modify the value of a control being deployed.
diff --git a/src/Umbraco.Infrastructure/Models/GridValue.cs b/src/Umbraco.Infrastructure/Models/GridValue.cs
index e873287ffb..a83d235b55 100644
--- a/src/Umbraco.Infrastructure/Models/GridValue.cs
+++ b/src/Umbraco.Infrastructure/Models/GridValue.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
@@ -63,7 +63,7 @@ namespace Umbraco.Cms.Core.Models
public class GridControl
{
[JsonProperty("value")]
- public JToken Value { get; set; } = null!;
+ public JToken? Value { get; set; }
[JsonProperty("editor")]
public GridEditor Editor { get; set; } = null!;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/GridPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/GridPropertyEditor.cs
index ca2dcefbbf..a0423a41f0 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/GridPropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/GridPropertyEditor.cs
@@ -300,8 +300,8 @@ namespace Umbraco.Cms.Core.PropertyEditors
if (mediaValues is not null)
{
- foreach (var umbracoEntityReference in mediaValues.Where(x => x.Value.HasValues)
- .SelectMany(x => _mediaPickerPropertyValueEditor.GetReferences(x.Value["udi"])))
+ foreach (var umbracoEntityReference in mediaValues.Where(x => x.Value?.HasValues ?? false)
+ .SelectMany(x => _mediaPickerPropertyValueEditor.GetReferences(x.Value!["udi"])))
{
yield return umbracoEntityReference;
}
diff --git a/src/Umbraco.Infrastructure/Templates/HtmlMacroParameterParser.cs b/src/Umbraco.Infrastructure/Templates/HtmlMacroParameterParser.cs
index fc6e08c0cd..7522585f47 100644
--- a/src/Umbraco.Infrastructure/Templates/HtmlMacroParameterParser.cs
+++ b/src/Umbraco.Infrastructure/Templates/HtmlMacroParameterParser.cs
@@ -57,7 +57,7 @@ namespace Umbraco.Cms.Infrastructure.Templates
foreach (var macroGridControl in macroGridControls)
{
// Deserialise JSON of Macro Grid Control to a class
- var gridMacro = macroGridControl.Value.ToObject();
+ var gridMacro = macroGridControl.Value?.ToObject();
// Collect any macro parameters that contain the media udi format
if (gridMacro is not null && gridMacro.MacroParameters is not null && gridMacro.MacroParameters.Any())
{