From f3a7ef42f611ecce2779e6b0e96100e9513e8590 Mon Sep 17 00:00:00 2001 From: Himali Malvawala <86650000+Himali-Malvawala@users.noreply.github.com> Date: Wed, 10 Apr 2024 17:11:57 +0530 Subject: [PATCH] improve: checkbox option (#261) --- src/forms/components/FormSubmissions.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/forms/components/FormSubmissions.tsx b/src/forms/components/FormSubmissions.tsx index af11fd7b..60870f46 100644 --- a/src/forms/components/FormSubmissions.tsx +++ b/src/forms/components/FormSubmissions.tsx @@ -54,7 +54,7 @@ export const FormSubmissions: React.FC = (props) => { const key: string = Object.keys(resultValue)[0]; if (question.fieldType === "Checkbox") { const splitAnswer = answer?.value?.split(","); - if (splitAnswer.indexOf(key) > -1) resultValue[key] = resultValue[key] + 1; + if (splitAnswer?.indexOf(key) > -1) resultValue[key] = resultValue[key] + 1; } else { if (key === answer?.value) resultValue[key] = resultValue[key] + 1; }