From 03639f6535f643ad115ea9f4b3cb4111d29321a5 Mon Sep 17 00:00:00 2001 From: Matt Roberts <7544022+mttrbrts@users.noreply.github.com> Date: Thu, 21 Oct 2021 19:52:27 +0100 Subject: [PATCH] fix(modelBuilderVisitor): crash when missing superType (#358) Signed-off-by: Matt Roberts --- packages/ui-concerto/src/modelBuilderVisitor.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/ui-concerto/src/modelBuilderVisitor.js b/packages/ui-concerto/src/modelBuilderVisitor.js index 7deea7c..577c638 100644 --- a/packages/ui-concerto/src/modelBuilderVisitor.js +++ b/packages/ui-concerto/src/modelBuilderVisitor.js @@ -70,14 +70,14 @@ class ModelBuilderVisitor extends ReactFormVisitor { visitMetaConceptDeclaration(declaration, parameters) { const props = declaration.getProperties(); - const className = props.find(({ name }) => name === 'name'); + const identifier = props.find(({ name }) => name === 'name'); const superType = props.find(({ name }) => name === 'superType'); const properties = props.find(({ name }) => name === 'properties'); return
-
-
{className.accept(this, parameters)}
-
{superType.accept(this, parameters)}
+
+
{identifier.accept(this, parameters)}
+ {superType &&
{superType.accept(this, parameters)}
}
{properties.accept(this, parameters)}