From 617762f1c51e541a92854ea371448846d6dd7b51 Mon Sep 17 00:00:00 2001 From: Abhinav-grd Date: Sat, 14 Aug 2021 10:47:38 +0530 Subject: [PATCH] added check for not null befor executing function --- src/components/MessageDialog.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/MessageDialog.tsx b/src/components/MessageDialog.tsx index 7a4440206..92ca4c5e9 100644 --- a/src/components/MessageDialog.tsx +++ b/src/components/MessageDialog.tsx @@ -68,7 +68,8 @@ export default function MessageDialog({ attributes.close?.variant ?? 'secondary' }`} onClick={() => { - attributes.close?.action(); + attributes.close.action && + attributes.close?.action(); props.onHide(); }} style={{