From ed5ad8989a116e5c8358b72ef1a0544b31cb10d1 Mon Sep 17 00:00:00 2001 From: Sebastian Leidig Date: Tue, 2 Jul 2024 13:44:58 +0200 Subject: [PATCH] fix(core): handle undefined enum value in display-configurable-enum.component.ts gracefully --- .../display-configurable-enum.component.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/app/core/basic-datatypes/configurable-enum/display-configurable-enum/display-configurable-enum.component.ts b/src/app/core/basic-datatypes/configurable-enum/display-configurable-enum/display-configurable-enum.component.ts index dbe4456151..7a5eb4f3dd 100644 --- a/src/app/core/basic-datatypes/configurable-enum/display-configurable-enum/display-configurable-enum.component.ts +++ b/src/app/core/basic-datatypes/configurable-enum/display-configurable-enum/display-configurable-enum.component.ts @@ -23,6 +23,14 @@ export class DisplayConfigurableEnumComponent iterableValue: ConfigurableEnumValue[] = []; ngOnInit() { + this.initValue(); + } + + private initValue() { + if (!this.value) { + return; + } + if (Array.isArray(this.value)) { this.iterableValue = this.value; } else if (this.value) {