diff --git a/library/src/containers/Sidebar/Sidebar.tsx b/library/src/containers/Sidebar/Sidebar.tsx index aa3b0534b..92b3d2df8 100644 --- a/library/src/containers/Sidebar/Sidebar.tsx +++ b/library/src/containers/Sidebar/Sidebar.tsx @@ -23,11 +23,11 @@ export const Sidebar: React.FunctionComponent = () => { .get('x-logo') ?.value(); const components = asyncapi.components(); - const messages = components && components.messages().all(); - const schemas = components && components.schemas().all(); + const messages = components?.messages().all(); + const schemas = components?.schemas().all(); const hasOperations = asyncapi.operations().length > 0; - const messagesList = messages && messages.length > 0 && ( + const messagesList = messages?.length > 0 && (
  • {
  • ); - const schemasList = schemas && schemas.length > 0 && ( + const schemasList = schemas?.length > 0 && (