diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2019-10-21 09:25:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-21 09:25:46 +0200 |
commit | c92e64b5376b2143151d29b7e1bd679267d576c2 (patch) | |
tree | 0706bd3fd8e161bbd3bf4113986f5fa8f89d428c /apps/workflowengine | |
parent | 83674f1b925107abb2500931f09a07fd2983c3af (diff) | |
parent | 99c30453dda8d469f0a2fad8eb11745b3435867a (diff) | |
download | nextcloud-server-c92e64b5376b2143151d29b7e1bd679267d576c2.tar.gz nextcloud-server-c92e64b5376b2143151d29b7e1bd679267d576c2.zip |
Merge pull request #17545 from nextcloud/bugfix/noid/workflow-catch
Ignore unavailable entity/operation classes
Diffstat (limited to 'apps/workflowengine')
-rw-r--r-- | apps/workflowengine/lib/AppInfo/Application.php | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/apps/workflowengine/lib/AppInfo/Application.php b/apps/workflowengine/lib/AppInfo/Application.php index f5653a6e48c..cea6ac7a1e5 100644 --- a/apps/workflowengine/lib/AppInfo/Application.php +++ b/apps/workflowengine/lib/AppInfo/Application.php @@ -22,6 +22,7 @@ namespace OCA\WorkflowEngine\AppInfo; use OCA\WorkflowEngine\Manager; +use OCP\AppFramework\QueryException; use OCP\Template; use OCA\WorkflowEngine\Controller\RequestTime; use OCP\WorkflowEngine\IEntity; @@ -89,12 +90,16 @@ class Application extends \OCP\AppFramework\App { $eventName, function (GenericEvent $event) use ($eventName, $operationClass, $entityClass) { $ruleMatcher = $this->manager->getRuleMatcher(); - /** @var IEntity $entity */ - $entity = $this->getContainer()->query($entityClass); - $entity->prepareRuleMatcher($ruleMatcher, $eventName, $event); - /** @var IOperation $operation */ - $operation = $this->getContainer()->query($operationClass); - $operation->onEvent($eventName, $event, $ruleMatcher); + try { + /** @var IEntity $entity */ + $entity = $this->getContainer()->query($entityClass); + $entity->prepareRuleMatcher($ruleMatcher, $eventName, $event); + /** @var IOperation $operation */ + $operation = $this->getContainer()->query($operationClass); + $operation->onEvent($eventName, $event, $ruleMatcher); + } catch (QueryException $e) { + // Ignore query exceptions since they might occur when an entity/operation were setup before by an app that is disabled now + } } ); }, $eventNames); |