Skip to content

Commit d053b44

Browse files
Merge branch 'v13/dev' into v14/dev
2 parents 4d28c3a + 93d72fb commit d053b44

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/Umbraco.Deploy.Contrib/Migrators/Legacy/DataType/PreValuesDataTypeArtifactJsonMigrator.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.Text.Json;
21
using System.Text.Json.Nodes;
32
using Umbraco.Cms.Core.Semver;
43
using Umbraco.Deploy.Infrastructure.Artifacts;
@@ -31,10 +30,17 @@ public override JsonNode Migrate(JsonNode artifactJson)
3130

3231
// Convert pre-value serialized JSON to actual JSON objects/arrays
3332
if (value is JsonValue jsonValue &&
34-
jsonValue.TryGetValue(out string? json) &&
35-
json.DetectIsJson())
33+
jsonValue.TryGetValue(out string? json))
3634
{
37-
value = JsonNode.Parse(json);
35+
if (string.IsNullOrEmpty(json))
36+
{
37+
// Skip empty value
38+
continue;
39+
}
40+
else if (json.DetectIsJson())
41+
{
42+
value = JsonNode.Parse(json);
43+
}
3844
}
3945

4046
configuration.Add(preValue.Key, value);

0 commit comments

Comments
 (0)