From 919fc6b086df39c9f600d3a78b5e6ac8ea492c7e Mon Sep 17 00:00:00 2001
From: Josua Vogel <j.vogel97@web.de>
Date: Fri, 27 May 2022 16:02:54 +0200
Subject: [PATCH] [BUGFIX] Avoid invalid type exception in
 FinisherVariableProvider
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guard invalid argument type exception by using null coalescing operator
in `\TYPO3\CMS\Form\Domain\Finishers\FinisherVariableProvider`.

Resolves: #97699
Releases: main, 11.5, 10.4
Change-Id: I6312fb35d52857004e0467a20e215fc4095e0037
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74932
Reviewed-by: Stephan Großberndt <stephan.grossberndt@typo3.org>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: Oliver Bartsch <bo@cedev.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
---
 .../form/Classes/Domain/Finishers/FinisherVariableProvider.php  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/typo3/sysext/form/Classes/Domain/Finishers/FinisherVariableProvider.php b/typo3/sysext/form/Classes/Domain/Finishers/FinisherVariableProvider.php
index 07e707c2519e..25230025671d 100644
--- a/typo3/sysext/form/Classes/Domain/Finishers/FinisherVariableProvider.php
+++ b/typo3/sysext/form/Classes/Domain/Finishers/FinisherVariableProvider.php
@@ -97,7 +97,7 @@ final class FinisherVariableProvider implements \ArrayAccess, \IteratorAggregate
     public function exists($finisherIdentifier, $key): bool
     {
         try {
-            ArrayUtility::getValueByPath($this->objects[$finisherIdentifier], $key, '.');
+            ArrayUtility::getValueByPath($this->objects[$finisherIdentifier] ?? [], $key, '.');
         } catch (MissingArrayPathException $e) {
             return false;
         }
-- 
GitLab