diff --git a/frontend/src/app/core/apiv3/cache/cachable-apiv3-collection.ts b/frontend/src/app/core/apiv3/cache/cachable-apiv3-collection.ts index 73857b758d..8fd6b207e6 100644 --- a/frontend/src/app/core/apiv3/cache/cachable-apiv3-collection.ts +++ b/frontend/src/app/core/apiv3/cache/cachable-apiv3-collection.ts @@ -60,7 +60,7 @@ export abstract class CachableAPIV3Collection< tap( (response:R) => { if (response instanceof CollectionResource) { - response.elements.forEach(this.touch.bind(this)); + response.elements?.forEach(this.touch.bind(this)); } else if (response instanceof HalResource) { this.touch(response as any); } diff --git a/frontend/src/app/core/current-user/current-user.service.ts b/frontend/src/app/core/current-user/current-user.service.ts index b6e52707af..b5c107b8c2 100644 --- a/frontend/src/app/core/current-user/current-user.service.ts +++ b/frontend/src/app/core/current-user/current-user.service.ts @@ -124,6 +124,8 @@ export class CurrentUserService { // The current page is the only page, return the results. return of(data.elements); }), + // Elements may incorrectly be undefined here due to the way the representer works + map((elements) => elements || []), ) .subscribe((capabilities) => { this.currentUserStore.update((state) => ({