X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/c276ce4c8dd3cf27ad6d17eca9af473f353fda55..7da8834efcac17c997d6a7f7a557b7865b1c1137:/src/services/ancestors-service/ancestors-service.ts?ds=sidebyside diff --git a/src/services/ancestors-service/ancestors-service.ts b/src/services/ancestors-service/ancestors-service.ts index f90b4a30..44e4eef5 100644 --- a/src/services/ancestors-service/ancestors-service.ts +++ b/src/services/ancestors-service/ancestors-service.ts @@ -14,17 +14,21 @@ export class AncestorService { private userService: UserService ) { } - async ancestors(uuid: string, rootUuid: string): Promise> { + async ancestors(uuid: string, rootUuid: string): Promise> { 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 [];