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 authored and dkd-kaehm committed Aug 29, 2023
1 parent b15df83 commit ee4b19c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Classes/Task/EventQueueWorkerTaskAdditionalFieldProvider.php
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 ee4b19c

Please sign in to comment.