mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Check background job type
It is assumed that a job class loaded from the jobs table is an IJob, but due to programming error the job might be of another type. Then the setters will most likely fail. This patch adds an interface type check so only correct jobs are used, anything else is ignored. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
df89e7fd39
commit
b17c4a6072
1 changed files with 4 additions and 0 deletions
|
|
@ -311,6 +311,10 @@ class JobList implements IJobList {
|
|||
}
|
||||
}
|
||||
|
||||
if (!($job instanceof IJob)) {
|
||||
// This most likely means an invalid job was enqueued. We can ignore it.
|
||||
return null;
|
||||
}
|
||||
$job->setId((int) $row['id']);
|
||||
$job->setLastRun((int) $row['last_run']);
|
||||
$job->setArgument(json_decode($row['argument'], true));
|
||||
|
|
|
|||
Loading…
Reference in a new issue