From bb473171a5cdfe78f9f1cc826a08af80010663ff Mon Sep 17 00:00:00 2001
From: Daniel Siepmann <daniel.siepmann@typo3.org>
Date: Thu, 13 Feb 2020 12:44:46 +0100
Subject: [PATCH] [BUGFIX] Prevent PHP Warning for count() in scheduler for
 sqlite

As serialized_executions might be false instead of an array, check type
first. This ensures there will be no php warning

Resolves: #90220
Releases: master
Change-Id: Ic0bf283cc2ab93b6718b491452d431b5d63114bf
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63234
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Susanne Moog <look@susi.dev>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Susanne Moog <look@susi.dev>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
---
 typo3/sysext/scheduler/Classes/Scheduler.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/typo3/sysext/scheduler/Classes/Scheduler.php b/typo3/sysext/scheduler/Classes/Scheduler.php
index 6046f73cb609..f06a96643426 100644
--- a/typo3/sysext/scheduler/Classes/Scheduler.php
+++ b/typo3/sysext/scheduler/Classes/Scheduler.php
@@ -127,7 +127,7 @@ class Scheduler implements SingletonInterface, LoggerAwareInterface
                 }
             }
             $executionCount = count($executions);
-            if (count($serialized_executions) !== $executionCount) {
+            if (!is_array($serialized_executions) || count($serialized_executions) !== $executionCount) {
                 if ($executionCount === 0) {
                     $value = '';
                 } else {
-- 
GitLab