From 078a4ac9fe1cec9c2ba41b0ea8c5325131718135 Mon Sep 17 00:00:00 2001 From: nicolethoen Date: Thu, 13 Oct 2022 21:22:18 -0400 Subject: [PATCH] fix(Alert): prevent error being thrown when using invalid variant --- packages/react-core/src/components/Alert/AlertIcon.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-core/src/components/Alert/AlertIcon.tsx b/packages/react-core/src/components/Alert/AlertIcon.tsx index 4562b3aea2c..cccda81ac50 100644 --- a/packages/react-core/src/components/Alert/AlertIcon.tsx +++ b/packages/react-core/src/components/Alert/AlertIcon.tsx @@ -26,9 +26,9 @@ export interface AlertIconProps extends React.HTMLProps { export const AlertIcon = ({ variant, customIcon, className = '', ...props }: AlertIconProps) => { const Icon = variantIcons[variant]; - return ( + return Icon ? (
{customIcon || }
- ); + ) : null; };