From 43181b29c3d2e358fc72fa836f03417e21411a0a Mon Sep 17 00:00:00 2001 From: fzaninotto Date: Fri, 2 Feb 2024 18:27:21 +0100 Subject: [PATCH] Fix DeleteWithConfirmButton raises an error when the record is not loaded Closes #9630 --- .../ra-ui-materialui/src/button/DeleteWithConfirmButton.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ra-ui-materialui/src/button/DeleteWithConfirmButton.tsx b/packages/ra-ui-materialui/src/button/DeleteWithConfirmButton.tsx index f165ae098f8..ec328c2655e 100644 --- a/packages/ra-ui-materialui/src/button/DeleteWithConfirmButton.tsx +++ b/packages/ra-ui-materialui/src/button/DeleteWithConfirmButton.tsx @@ -84,7 +84,7 @@ export const DeleteWithConfirmButton = ( true ), }), - id: record.id, + id: record?.id, ...translateOptions, }} onConfirm={handleDelete}