Skip to content

Commit

Permalink
add null checks on gridRect to avoid safari error
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikkitory committed Jul 31, 2024
1 parent 0fb45c4 commit 61f8227
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/ZoomPanSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ export default class ZoomPanSelection extends Toolbar {
e.type === 'mouseleave'
) {
// we will be calling getBoundingClientRect on each mousedown/mousemove/mouseup
let gridRectDim = me.gridRect.getBoundingClientRect()
let gridRectDim = me.gridRect?.getBoundingClientRect()

if (me.w.globals.mousedown) {
if (gridRectDim && me.w.globals.mousedown) {
// user released the drag, now do all the calculations
me.endX = me.clientX - gridRectDim.left
me.endY = me.clientY - gridRectDim.top
Expand Down

0 comments on commit 61f8227

Please sign in to comment.