X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/59ee572e791985a36bdd2015c9b494145109e8ed..a2bf1ed3a15cf55e426c51ad8e6febd7ff2e3020:/src/services/ancestors-service/ancestors-service.ts 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 [];