Skip to content

Commit

Permalink
Merge pull request #7 from Flowpack/bugfix/targetPropertyValue
Browse files Browse the repository at this point in the history
BUGFIX: Run unregisterUsageInNode only if $targetPropertyValue is set
  • Loading branch information
Sebobo authored Jun 28, 2022
2 parents ac8bfa6 + 10dbc23 commit f0ddc68
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Classes/Service/AssetIntegrationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ public function beforeNodePublishing(NodeInterface $node, Workspace $targetWorks
// Unregister the asset stored in the target node, the assets will be registered again after publishing
if ($targetNode && $targetNode->hasProperty($propertyName)) {
$targetPropertyValue = $targetNode->getProperty($propertyName);
$this->unregisterUsageInNode($targetNode, $targetPropertyValue, false);
if ($targetPropertyValue) {
$this->unregisterUsageInNode($targetNode, $targetPropertyValue, false);
}
}
$this->unregisterUsageInNode($node, $propertyValue, false);
}
Expand Down

0 comments on commit f0ddc68

Please sign in to comment.