Skip to content

Commit

Permalink
Avoid exception when cursor was removed from DOM already
Browse files Browse the repository at this point in the history
  • Loading branch information
sbungartz committed Jan 31, 2024
1 parent 48c8e41 commit bd32922
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/util/cursor.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ export default class Cursor {
this._target.removeEventListener('mousemove', this._eventHandlers.mousemove, options);
this._target.removeEventListener('mouseup', this._eventHandlers.mouseup, options);

document.body.removeChild(this._canvas);
if (document.contains(this._canvas)) {
document.body.removeChild(this._canvas);
}
}

this._target = null;
Expand Down

0 comments on commit bd32922

Please sign in to comment.