refs #master Merge branch 'origin/master' into 14186-progress-indicator-store
[arvados-workbench2.git] / src / services / ancestors-service / ancestors-service.ts
index f90b4a3053ca1744c2228a51c4c45177bf644c87..44e4eef5c944b271eba16c558b43a4d700c4f886 100644 (file)
@@ -14,17 +14,21 @@ export class AncestorService {
         private userService: UserService
     ) { }
 
-    async ancestors(uuid: string, rootUuid: string): Promise<Array<UserResource | GroupResource | TrashableResource>> {
+    async ancestors(uuid: string, rootUuid: string): Promise<Array<UserResource | GroupResource>> {
         const service = this.getService(extractUuidObjectType(uuid));
         if (service) {
-            const resource = await service.get(uuid);
-            if (uuid === rootUuid) {
-                return [resource];
-            } else {
-                return [
-                    ...await this.ancestors(resource.ownerUuid, rootUuid),
-                    resource
-                ];
+            try {
+                const resource = await service.get(uuid);
+                if (uuid === rootUuid) {
+                    return [resource];
+                } else {
+                    return [
+                        ...await this.ancestors(resource.ownerUuid, rootUuid),
+                        resource
+                    ];
+                }
+            } catch (e) {
+                return [];
             }
         } else {
             return [];