Skip to content

Commit

Permalink
Avoid changing root-ness of assets
Browse files Browse the repository at this point in the history
  • Loading branch information
einarmo committed Sep 9, 2024
1 parent 11df628 commit f9821b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Extractor/Pushers/PusherUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ private static bool ShouldSetNewMetadata(FullConfig config, Dictionary<string, s
if (update.Context && !newAsset.ParentId.IsNullNodeId)
{
var parentId = extractor.GetUniqueId(newAsset.ParentId);
if (parentId != old.ParentExternalId)
// Do not move an asset from root to non-root or the other way around.
if (parentId is null == old.ParentExternalId is null
&& parentId != old.ParentExternalId)
{
#pragma warning disable CS8604 // Possible null reference argument.
assetUpdate.ParentExternalId = new UpdateNullable<string>(parentId);
#pragma warning restore CS8604 // Possible null reference argument.
assetUpdate.ParentExternalId = new UpdateNullable<string?>(parentId);
}
}

Expand Down

0 comments on commit f9821b6

Please sign in to comment.