diff --git a/lib/private/backgroundjob/joblist.php b/lib/private/backgroundjob/joblist.php index 6641097cf9..09bba53edb 100644 --- a/lib/private/backgroundjob/joblist.php +++ b/lib/private/backgroundjob/joblist.php @@ -152,6 +152,10 @@ class JobList implements IJobList { if ($class === 'OC_Cache_FileGlobalGC') { $class = '\OC\Cache\FileGlobalGC'; } + if (class_exists($class)) { + // job from disabled app or old version of an app, no need to do anything + return null; + } $job = new $class(); $job->setId($row['id']); $job->setLastRun($row['last_run']); diff --git a/lib/private/backgroundjob/legacy/queuedjob.php b/lib/private/backgroundjob/legacy/queuedjob.php index 2bc001103b..c5705abb46 100644 --- a/lib/private/backgroundjob/legacy/queuedjob.php +++ b/lib/private/backgroundjob/legacy/queuedjob.php @@ -13,6 +13,8 @@ class QueuedJob extends \OC\BackgroundJob\QueuedJob { $class = $argument['klass']; $method = $argument['method']; $parameters = $argument['parameters']; - call_user_func(array($class, $method), $parameters); + if (is_callable(array($class, $method))) { + call_user_func(array($class, $method), $parameters); + } } } diff --git a/lib/private/backgroundjob/legacy/regularjob.php b/lib/private/backgroundjob/legacy/regularjob.php index d4cfa348ce..eb85a30b4b 100644 --- a/lib/private/backgroundjob/legacy/regularjob.php +++ b/lib/private/backgroundjob/legacy/regularjob.php @@ -10,6 +10,8 @@ namespace OC\BackgroundJob\Legacy; class RegularJob extends \OC\BackgroundJob\Job { public function run($argument) { - call_user_func($argument); + if (is_callable($argument)) { + call_user_func($argument); + } } }