From ca615cbbe9b60e114862e7b04e0cbf7f2d37548e Mon Sep 17 00:00:00 2001 From: martinkrulltott Date: Fri, 29 Dec 2023 15:47:41 +0000 Subject: [PATCH] fix: prevent crash when stage filter is used and program is changed --- .../ProgramDimensionsPanel/ProgramDimensionsFilter.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/MainSidebar/ProgramDimensionsPanel/ProgramDimensionsFilter.js b/src/components/MainSidebar/ProgramDimensionsPanel/ProgramDimensionsFilter.js index 92682ed42..386ba396f 100644 --- a/src/components/MainSidebar/ProgramDimensionsPanel/ProgramDimensionsFilter.js +++ b/src/components/MainSidebar/ProgramDimensionsPanel/ProgramDimensionsFilter.js @@ -117,7 +117,11 @@ const ProgramDimensionsFilter = ({ {[OUTPUT_TYPE_ENROLLMENT, OUTPUT_TYPE_TRACKED_ENTITY].includes( useSelector(sGetUiInputType) ) && - dimensionType === DIMENSION_TYPE_DATA_ELEMENT && ( + dimensionType === DIMENSION_TYPE_DATA_ELEMENT && + (!stageFilter || + program?.programStages.some( + (stage) => stage.id === stageFilter + )) && (