Skip to content

Commit

Permalink
Merge pull request #4599 from Nikkitory/main
Browse files Browse the repository at this point in the history
Add null checks on gridRect to avoid safari error
  • Loading branch information
junedchhipa committed Jul 31, 2024
2 parents 0fb45c4 + 61f8227 commit b5f87f0
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 b5f87f0

Please sign in to comment.