From 80d605c4ecb89f8e0ecda1f8b0c19015c04e11e4 Mon Sep 17 00:00:00 2001 From: Konstantin Levin Date: Wed, 31 May 2023 15:41:36 +0200 Subject: [PATCH] #2717 remove conditional from isDataSGroup --- packages/ketcher-core/src/domain/entities/sgroup.ts | 2 +- .../src/script/ui/views/components/StructEditor/InfoPanel.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ketcher-core/src/domain/entities/sgroup.ts b/packages/ketcher-core/src/domain/entities/sgroup.ts index b972ea8497..1186b8ac0e 100644 --- a/packages/ketcher-core/src/domain/entities/sgroup.ts +++ b/packages/ketcher-core/src/domain/entities/sgroup.ts @@ -633,7 +633,7 @@ export class SGroup { } static isDataSGroup(sGroup: SGroup): boolean { - return sGroup?.type === SGroup.TYPES.DAT + return sGroup.type === SGroup.TYPES.DAT } static isExpandedSGroup(sGroup) { diff --git a/packages/ketcher-react/src/script/ui/views/components/StructEditor/InfoPanel.tsx b/packages/ketcher-react/src/script/ui/views/components/StructEditor/InfoPanel.tsx index 93bc2a7408..858372e4fd 100644 --- a/packages/ketcher-react/src/script/ui/views/components/StructEditor/InfoPanel.tsx +++ b/packages/ketcher-react/src/script/ui/views/components/StructEditor/InfoPanel.tsx @@ -119,7 +119,7 @@ const InfoPanel: FC = (props) => { const width = size.x const height = size.y - const showMolecule = molecule && !SGroup.isDataSGroup(sGroup) + const showMolecule = molecule && sGroup && !SGroup.isDataSGroup(sGroup) return showMolecule ? (