From 4a43de48d7f73ce4817505ab166ed7d8511969e6 Mon Sep 17 00:00:00 2001 From: Paras Date: Thu, 5 Oct 2023 23:44:55 +0530 Subject: [PATCH] refactor: added optional chain expression --- library/src/containers/Servers/Security.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/library/src/containers/Servers/Security.tsx b/library/src/containers/Servers/Security.tsx index 2575c286b..21569a7d7 100644 --- a/library/src/containers/Servers/Security.tsx +++ b/library/src/containers/Servers/Security.tsx @@ -26,8 +26,7 @@ export const Security: React.FunctionComponent = ({ let renderedSecurities; if ( - !security || - !security.length || + !security?.length || !securitySchemes || !Object.keys(securitySchemes).length ) { @@ -276,7 +275,7 @@ const SecurityItem: React.FunctionComponent = ({ )} - {securitySchema && securitySchema.hasDescription() && ( + {securitySchema?.hasDescription() && (
{securitySchema.description()}