Merge pull request #6626 from JakubOnderka/no-empty-job

fix: [internal] Do not try to fetch empty job
pull/6628/head
Jakub Onderka 2020-11-19 19:30:25 +01:00 committed by GitHub
commit af0e4f354d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -1976,9 +1976,13 @@ class AppModel extends Model
}
$db_version = $db_version[0];
$updates = $this->__findUpgrades($db_version['AdminSetting']['value']);
$job = $this->Job->find('first', array(
'conditions' => array('Job.id' => $processId)
));
if ($processId) {
$job = $this->Job->find('first', array(
'conditions' => array('Job.id' => $processId)
));
} else {
$job = null;
}
if (!empty($updates)) {
// Exit if updates are locked.
// This is not as reliable as a real lock implementation