From 04cc7817ee815e9eade772732db596d47927c514 Mon Sep 17 00:00:00 2001 From: cskwrd Date: Wed, 19 Apr 2023 05:15:26 -0500 Subject: [PATCH] web/admin: fix blueprint instance list without metadata or labels (#5296) * Update BlueprintListPage.ts `Object.hasOwn()` throws an exception if the first argument is `null` or `undefined`. This change ensures that the first argument is never `null` or `undefined`. Signed-off-by: cskwrd * Update web/src/admin/blueprints/BlueprintListPage.ts Signed-off-by: Jens L. Signed-off-by: Jens Langhammer --------- Signed-off-by: cskwrd Signed-off-by: Jens L. Signed-off-by: Jens Langhammer Co-authored-by: Jens L --- web/src/admin/blueprints/BlueprintListPage.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/src/admin/blueprints/BlueprintListPage.ts b/web/src/admin/blueprints/BlueprintListPage.ts index 23463382b..6c91bbe46 100644 --- a/web/src/admin/blueprints/BlueprintListPage.ts +++ b/web/src/admin/blueprints/BlueprintListPage.ts @@ -126,7 +126,11 @@ export class BlueprintListPage extends TablePage { row(item: BlueprintInstance): TemplateResult[] { let description = undefined; const descKey = "blueprints.goauthentik.io/description"; - if (Object.hasOwn(item.metadata?.labels, descKey)) { + if ( + item.metadata && + item.metadata.labels && + Object.hasOwn(item.metadata?.labels, descKey) + ) { description = item.metadata?.labels[descKey]; } return [