From 4625eab0e2e65611b0d7b1cbf2422f998345eea8 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Fri, 23 Feb 2024 10:42:36 +0100 Subject: [PATCH 1/2] fix: Non-optional accessor --- app/configurator/components/field.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/configurator/components/field.tsx b/app/configurator/components/field.tsx index 682fd0fcb..901100c4a 100644 --- a/app/configurator/components/field.tsx +++ b/app/configurator/components/field.tsx @@ -243,7 +243,9 @@ export const DataFilterSelect = ({ const canUseMostRecentValue = isTemporalOrdinalDimension(dimension); const usesMostRecentValue = isDynamicMaxValue(fieldProps.value); - const maxValue = sortedValues[sortedValues.length - 1].value; + // Dimension values can be empty just before a filter is reloaded through + // ensurePossibleFilters + const maxValue = sortedValues[sortedValues.length - 1]?.value; return (