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
No known key found for this signature in database
GPG key ID: 55C211A1226CB17D

View file

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