From 10dbc2358c3604ef0ef3f7a6d0d1e5f2c904af6f Mon Sep 17 00:00:00 2001 From: Jon Uhlmann Date: Mon, 27 Jun 2022 18:33:42 +0200 Subject: [PATCH] BUGFIX: Run unregisterUsageInNode only if $targetPropertyValue is set --- Classes/Service/AssetIntegrationService.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Classes/Service/AssetIntegrationService.php b/Classes/Service/AssetIntegrationService.php index 33b2ffd..06eae09 100644 --- a/Classes/Service/AssetIntegrationService.php +++ b/Classes/Service/AssetIntegrationService.php @@ -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); }