]> source.dussan.org Git - nextcloud-server.git/commitdiff
Ignore unavailable entity/operation classes 17545/head
authorJulius Härtl <jus@bitgrid.net>
Tue, 15 Oct 2019 10:54:22 +0000 (12:54 +0200)
committerJulius Härtl <jus@bitgrid.net>
Tue, 15 Oct 2019 10:54:22 +0000 (12:54 +0200)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
apps/workflowengine/lib/AppInfo/Application.php

index f5653a6e48c8c2ebea4ca2792f26325084e14574..cea6ac7a1e54900377f75bb8668982218e427911 100644 (file)
@@ -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);