Skip to content

Commit

Permalink
Fix null exception when section properties is null
Browse files Browse the repository at this point in the history
Fix: Fix null exception when section properties is null
  • Loading branch information
akfakmot committed Nov 12, 2024
1 parent a9cb03a commit 620c23b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions KVA/Migration.Tool.Source/Services/PageBuilderPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,12 @@ private async Task<bool> WalkSections(int siteId, List<SectionConfiguration> sec
logger.LogTrace("Walk section {TypeIdentifier}|{Identifier}", section.TypeIdentifier, section.Identifier);

var sectionFcs = sourceInstanceContext.GetSectionFormComponents(siteId, section.TypeIdentifier);
bool ndp1 = await MigrateProperties(siteId, section.Properties, sectionFcs, new Dictionary<string, IWidgetPropertyMigration>());
needsDeferredPatch = ndp1 || needsDeferredPatch;

if (section.Properties is { Count: > 0 } properties)
{
bool ndp1 = await MigrateProperties(siteId, properties, sectionFcs, new Dictionary<string, IWidgetPropertyMigration>());
needsDeferredPatch = ndp1 || needsDeferredPatch;
}

if (section.Zones is { Count: > 0 })
{
Expand Down
2 changes: 1 addition & 1 deletion Migration.Tool.Common/Model/EditableAreasConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public sealed class SectionConfiguration
[DataMember]
[JsonProperty("properties")]
// public ISectionProperties Properties { get; set; }
public JObject Properties { get; set; }
public JObject? Properties { get; set; }

/// <summary>Zones within the section.</summary>
[DataMember]
Expand Down

0 comments on commit 620c23b

Please sign in to comment.