diff --git a/plugins/system/schemaorg/src/Extension/Schemaorg.php b/plugins/system/schemaorg/src/Extension/Schemaorg.php index f8334d6bccd50..1652c79d47025 100644 --- a/plugins/system/schemaorg/src/Extension/Schemaorg.php +++ b/plugins/system/schemaorg/src/Extension/Schemaorg.php @@ -566,11 +566,14 @@ protected function isSupported($context) */ public function onContentAfterDelete(Model\AfterDeleteEvent $event) { - if (!$this->isSupported($event->getContext())) { + $context = $event->getContext(); + $itemId = $event->getItem()->id ?? 0; + + if (!$itemId || !$this->isSupported($context)) { return; } - $this->deleteSchemaOrg($event->getItem()->id, $event->getContext()); + $this->deleteSchemaOrg($itemId, $context); } /**