Skip to content

Commit

Permalink
check null
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-coding authored Nov 21, 2023
1 parent 8180899 commit cfb1398
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/viewer2d.js
Original file line number Diff line number Diff line change
Expand Up @@ -830,10 +830,12 @@ class Viewer2D {
const _this = this;
if (!_this.inited)
return;
e.preventDefault();
if (e) {
e.preventDefault();
}

let moved = null;
if (_this.firstDragPoint) {
if (e && _this.firstDragPoint) {
moved = {
x: e.clientX - _this.firstDragPoint.x,
y: e.clientY - _this.firstDragPoint.y
Expand Down

0 comments on commit cfb1398

Please sign in to comment.