diff --git a/app/Model/Correlation.php b/app/Model/Correlation.php index 28d2dec58..77e04b766 100644 --- a/app/Model/Correlation.php +++ b/app/Model/Correlation.php @@ -141,14 +141,13 @@ class Correlation extends AppModel if (Configure::read('MISP.background_jobs') && $jobId) { $this->Job = ClassRegistry::init('Job'); $this->Job->id = $jobId; + if (!$this->Job->exists()) { + $jobId = false; + } } else { $jobId = false; } - if(!$this->Job->exists()){ - $jobId = false; - } - if (!empty($eventIds)) { $eventCount = count($eventIds); foreach ($eventIds as $j => $currentEventId) {