From 13fa9c5c0b4052a0dc7a2166c2ff0db505c754db Mon Sep 17 00:00:00 2001 From: Stefan Dirix Date: Thu, 18 Apr 2024 17:43:34 +0200 Subject: [PATCH] fix empty enum values --- packages/core/src/util/label.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/core/src/util/label.ts b/packages/core/src/util/label.ts index 64cd4ef2c..80e9fd8ef 100644 --- a/packages/core/src/util/label.ts +++ b/packages/core/src/util/label.ts @@ -132,7 +132,12 @@ export const computeChildLabel = ( return ''; } - const currentValue = get(childData, childLabelProp, ''); + const currentValue = get(childData, childLabelProp); + + // in case there is no value, then we can't map it to an enum or oneOf + if (currentValue === undefined) { + return ''; + } // check whether the value is part of a oneOf or enum and needs to be translated const childSchema = Resolve.schema(