1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-11 20:22:36 +03:00

Add some null guards

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner
2021-07-23 10:07:09 +02:00
parent 2fd221bc18
commit 8d5fd9306f

View File

@@ -97,13 +97,13 @@ export default class ImageView extends React.Component<IProps, IState> {
thumbnailInfo?.positionX +
(thumbnailInfo?.width / 2) -
(UIStore.instance.windowWidth / 2)
),
) ?? 0,
translationY: (
thumbnailInfo?.positionY +
(thumbnailInfo?.height / 2) -
(UIStore.instance.windowHeight / 2) -
(PANEL_HEIGHT / 2)
),
) ?? 0,
moving: false,
contextMenuDisplayed: false,
};