From 6e6211f1f21ffb47ecaad962f2b317b5d5fe62f9 Mon Sep 17 00:00:00 2001 From: Jette Petzold Date: Thu, 12 Sep 2024 15:35:09 +0200 Subject: [PATCH] added check whether value for a variable in a UCA is defined to avoid error --- .../stpa/contextTable/context-dataProvider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension/src-language-server/stpa/contextTable/context-dataProvider.ts b/extension/src-language-server/stpa/contextTable/context-dataProvider.ts index 3333dc8..01de375 100644 --- a/extension/src-language-server/stpa/contextTable/context-dataProvider.ts +++ b/extension/src-language-server/stpa/contextTable/context-dataProvider.ts @@ -105,7 +105,7 @@ export class ContextTableProvider { // determine context variables const contextVariables: ContextTableVariable[] = []; for (const assignedValue of context.assignedValues) { - if (assignedValue.variable.ref?.name) { + if (assignedValue.variable?.ref?.name && assignedValue.value?.$refText) { contextVariables.push({ name: assignedValue.variable.ref.name, value: assignedValue.value.$refText }); } }