From e1cb939b7f55ce92d5f1b45da382b1a988e3fc5e Mon Sep 17 00:00:00 2001 From: Kevin Papst Date: Mon, 23 Sep 2024 11:03:17 +0200 Subject: [PATCH] failsafe type check --- EventSubscriber/SharedProjectSubscriber.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/EventSubscriber/SharedProjectSubscriber.php b/EventSubscriber/SharedProjectSubscriber.php index c3f5a47..8822711 100644 --- a/EventSubscriber/SharedProjectSubscriber.php +++ b/EventSubscriber/SharedProjectSubscriber.php @@ -28,10 +28,9 @@ public function onActions(PageActionsEvent $event): void return; } - /** @var SharedProjectTimesheet $sharedProject */ $sharedProject = $payload['sharedProject']; - if ($sharedProject->getId() === null || $sharedProject->getType() === null) { + if (!$sharedProject instanceof SharedProjectTimesheet || $sharedProject->getId() === null) { return; }