From 47b1021310706c656c806a92a27fd6554a2801d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Sch=C3=BCle?= Date: Thu, 10 Oct 2024 09:54:41 +0200 Subject: [PATCH] tweak(Calendar/Frontend/WebDAV): httpRequest might be null ... in certain cases (phpunit-tests?) --- tine20/Calendar/Frontend/WebDAV/Container.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tine20/Calendar/Frontend/WebDAV/Container.php b/tine20/Calendar/Frontend/WebDAV/Container.php index c7204ad94c..6688fec1e9 100644 --- a/tine20/Calendar/Frontend/WebDAV/Container.php +++ b/tine20/Calendar/Frontend/WebDAV/Container.php @@ -96,7 +96,9 @@ public function getChild($_name) // lie about existence of event if request is a PUT request from an ATTENDEE for an already existing event // to prevent ugly (and not helpful) error messages on the client - if (isset($_SERVER['REQUEST_METHOD']) && $httpRequest->getMethod() == 'PUT' && ($httpRequest->getHeader('If-None-Match') ?: null)?->getFieldValue() === '*') { + if (isset($_SERVER['REQUEST_METHOD']) && $httpRequest && $httpRequest->getMethod() === 'PUT' + && ($httpRequest->getHeader('If-None-Match') ?: null)?->getFieldValue() === '*' + ) { if ( $object->organizer != Tinebase_Core::getUser()->contact_id && Calendar_Model_Attender::getOwnAttender($object->attendee) !== null