From a5eeee63599b76015cec1c862656a45e9e6eaf89 Mon Sep 17 00:00:00 2001
From: Christian Kuhn <lolli@schwarzbu.ch>
Date: Tue, 15 Nov 2022 08:41:55 +0100
Subject: [PATCH] [BUGFIX] Array access on null in ConditionMatcher
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Resolves: #99088
Releases: main, 11.5
Change-Id: I67f799fdca4d736c36775d50b5ac753eba93ba52
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/76601
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.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>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 .../TypoScript/ConditionMatching/ConditionMatcher.php           | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/typo3/sysext/backend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php b/typo3/sysext/backend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php
index 15f4f10b2036..053ba6f5ee93 100644
--- a/typo3/sysext/backend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php
+++ b/typo3/sysext/backend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php
@@ -144,7 +144,7 @@ class ConditionMatcher extends AbstractConditionMatcher
                 $pageId = $id;
             } else {
                 $record = BackendUtility::getRecordWSOL($table, abs($id), '*', '', false);
-                $pageId = (int)$record['pid'];
+                $pageId = (int)($record['pid'] ?? 0);
             }
         }
         return $pageId;
-- 
GitLab