diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-10-15 12:54:22 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-10-15 12:54:22 +0200 |
commit | 99c30453dda8d469f0a2fad8eb11745b3435867a (patch) | |
tree | d8f9ecf9d6d53591dabbfcacdf3df011b5f3ffab | |
parent | 4011262fabd13eb5918e8b6a8091392bce75a287 (diff) | |
download | nextcloud-server-99c30453dda8d469f0a2fad8eb11745b3435867a.tar.gz nextcloud-server-99c30453dda8d469f0a2fad8eb11745b3435867a.zip |
Ignore unavailable entity/operation classes
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-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); |