From a8022e29047e462cc91e85e8d3c6fb00cdda9a02 Mon Sep 17 00:00:00 2001 From: Jiho Lee Date: Mon, 21 Nov 2022 15:21:38 +0900 Subject: [PATCH] fix: undefined id handling --- src/pages/tests/abn/create-update-base.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/tests/abn/create-update-base.tsx b/src/pages/tests/abn/create-update-base.tsx index 76a672a..00d66d2 100644 --- a/src/pages/tests/abn/create-update-base.tsx +++ b/src/pages/tests/abn/create-update-base.tsx @@ -42,7 +42,9 @@ export const CreateUpdateABNTestBase: React.FC = ({ const domainRef = useRef(null); const { id } = useParams(); - const abnTest = abnTests.find((test) => test.id === +id); + const abnTest = abnTests.find( + (test) => id !== undefined && test.id === +id + ); useEffect(() => { if (type === 'update' && abnTest) {