Skip to content

Commit

Permalink
[BUGFIX] prevent Exception when create Event Queue Worker Task
Browse files Browse the repository at this point in the history
Fixes: #3767
  • Loading branch information
Achim Fritz committed Aug 25, 2023
1 parent b15df83 commit a22c00b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Classes/Task/EventQueueWorkerTaskAdditionalFieldProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@ public function getAdditionalFields(
/** @var EventQueueWorkerTask $task */
$additionalFields = [];

if (!$task instanceof EventQueueWorkerTask) {
if (!$task === null && !$task instanceof EventQueueWorkerTask) {
return $additionalFields;
}
if ($schedulerModule->getCurrentAction()->equals(Action::ADD)) {
$taskInfo['solr_eventqueueworkertask_limit'] = EventQueueWorkerTask::DEFAULT_PROCESSING_LIMIT;
}

if ($schedulerModule->getCurrentAction()->equals(Action::EDIT)) {
$taskInfo['solr_eventqueueworkertask_limit'] = $task->getLimit();
Expand Down Expand Up @@ -95,6 +98,6 @@ public function saveAdditionalFields(
return;
}

$task->setLimit($submittedData['solr_eventqueueworkertask_limit']);
$task->setLimit((int)$submittedData['solr_eventqueueworkertask_limit']);
}
}

0 comments on commit a22c00b

Please sign in to comment.