From 94a08418663fbb327542f7be9e3909f383c8bc33 Mon Sep 17 00:00:00 2001
From: Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>
Date: Wed, 14 Oct 2020 11:48:16 +0800
Subject: Fixed bug showing up

cannot read ... of rect...
---
 src/client/views/presentationview/PresElementBox.tsx | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

(limited to 'src/client/views/presentationview/PresElementBox.tsx')

diff --git a/src/client/views/presentationview/PresElementBox.tsx b/src/client/views/presentationview/PresElementBox.tsx
index 9052967e5..adaabec8a 100644
--- a/src/client/views/presentationview/PresElementBox.tsx
+++ b/src/client/views/presentationview/PresElementBox.tsx
@@ -190,11 +190,11 @@ export class PresElementBox extends ViewBoxBaseComponent<FieldViewProps, PresDoc
 
     onPointerMove = (e: PointerEvent) => {
         const slide = this._itemRef.current!;
-        const rect = slide?.getBoundingClientRect();
-        let y = e.clientY - rect.top;  //y position within the element.
-        let height = slide.clientHeight;
-        let halfLine = height / 2;
-        if (DragManager.docsBeingDragged.length > 1) {
+        if (slide && DragManager.docsBeingDragged.length > 1) {
+            const rect = slide.getBoundingClientRect();
+            let y = e.clientY - rect.top;  //y position within the element.
+            let height = slide.clientHeight;
+            let halfLine = height / 2;
             if (y <= halfLine) {
                 slide.style.borderTop = "solid 2px #5B9FDD";
                 slide.style.borderBottom = "0px";
-- 
cgit v1.2.3-70-g09d2

