Skip to content

Commit

Permalink
[BUGFIX] Prevent method call on invalid task in scheduler
Browse files Browse the repository at this point in the history
Resolves: #94355
Releases: master, 10.4
Change-Id: Ibff208cf5e2165664a8e03952d207ece76be31e3
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/70254
Tested-by: core-ci <typo3@b13.com>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
lukasniestroj authored and lolli42 committed Aug 9, 2021
1 parent 4a61e02 commit c7996f0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions typo3/sysext/scheduler/Classes/Scheduler.php
Expand Up @@ -346,13 +346,13 @@ public function fetchTask($uid = 0)
}
/** @var Task\AbstractTask $task */
$task = unserialize($row['serialized_task_object']);
if ($task->getTaskGroup() === null) {
// Fix invalid task_group=NULL settings in order to avoid exceptions when saving on PostgreSQL
$task->setTaskGroup(0);
}
if ($this->isValidTaskObject($task)) {
// The task is valid, return it
$task->setScheduler();
if ($task->getTaskGroup() === null) {
// Fix invalid task_group=NULL settings in order to avoid exceptions when saving on PostgreSQL
$task->setTaskGroup(0);
}
} else {
// Forcibly set the disable flag to 1 in the database,
// so that the task does not come up again and again for execution
Expand Down

0 comments on commit c7996f0

Please sign in to comment.