From 26d1fea06ff6a9c9300090afecbbe90a67b6ebae Mon Sep 17 00:00:00 2001
From: Alexander Opitz <opitz.alexander@googlemail.com>
Date: Thu, 7 Sep 2017 09:48:21 +0200
Subject: [PATCH] [BUGFIX] PHP7.2: Check value for NULL before count

Resolves: #82322
Releases: master, 8.7, 7.6
Change-Id: I31f7bc2db61337e10be7ffd44ac294b77c44d07b
Reviewed-on: https://review.typo3.org/53939
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 typo3/sysext/core/Classes/DataHandling/DataHandler.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/typo3/sysext/core/Classes/DataHandling/DataHandler.php b/typo3/sysext/core/Classes/DataHandling/DataHandler.php
index 27a4b53704c1..bb61317aadf7 100644
--- a/typo3/sysext/core/Classes/DataHandling/DataHandler.php
+++ b/typo3/sysext/core/Classes/DataHandling/DataHandler.php
@@ -1875,7 +1875,10 @@ class DataHandler
             );
         }
 
-        $itemC = count($items);
+        $itemC = 0;
+        if ($items !== null) {
+            $itemC = count($items);
+        }
         if (!$itemC) {
             $itemC = 1;
         }
-- 
GitLab