From d0f70341867c6c191108bb2c29b597b66c7ff8b3 Mon Sep 17 00:00:00 2001 From: arodidev <51090527+arodidev@users.noreply.github.com> Date: Fri, 15 Dec 2023 17:51:04 +0300 Subject: [PATCH] addition of null checks --- .../src/views/program-management/tabs/mdr-tb.component.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/esm-tb-app/src/views/program-management/tabs/mdr-tb.component.tsx b/packages/esm-tb-app/src/views/program-management/tabs/mdr-tb.component.tsx index 27aa3743a..14d26c041 100644 --- a/packages/esm-tb-app/src/views/program-management/tabs/mdr-tb.component.tsx +++ b/packages/esm-tb-app/src/views/program-management/tabs/mdr-tb.component.tsx @@ -18,8 +18,8 @@ const MdrTbList: React.FC = ({ patientUuid }) => { useEffect(() => { fetchPatientLastEncounter(patientUuid, config.encounterTypes.tbProgramEnrollment).then((encounter) => { - const result = encounter.obs.filter((ob) => ob.concept.uuid === config.obsConcepts.outcome); - if (result.length) { + const result = encounter?.obs?.filter((ob) => ob?.concept?.uuid === config.obsConcepts.outcome); + if (result?.length) { setIsEmptyOutcome(false); } });