web/admin: fix error listing blueprints with missing metadata (#5041)

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L 2023-03-22 10:21:27 +01:00 committed by GitHub
parent 865138e7e7
commit 9abd4b3e14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -126,8 +126,8 @@ export class BlueprintListPage extends TablePage<BlueprintInstance> {
row(item: BlueprintInstance): TemplateResult[] { row(item: BlueprintInstance): TemplateResult[] {
let description = undefined; let description = undefined;
const descKey = "blueprints.goauthentik.io/description"; const descKey = "blueprints.goauthentik.io/description";
if (Object.hasOwn(item.metadata.labels, descKey)) { if (Object.hasOwn(item.metadata?.labels, descKey)) {
description = item.metadata.labels[descKey]; description = item.metadata?.labels[descKey];
} }
return [ return [
html`<div>${item.name}</div> html`<div>${item.name}</div>