Skip to content

Commit bd32922

Browse files
committed
Avoid exception when cursor was removed from DOM already
1 parent 48c8e41 commit bd32922

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/util/cursor.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ export default class Cursor {
6969
this._target.removeEventListener('mousemove', this._eventHandlers.mousemove, options);
7070
this._target.removeEventListener('mouseup', this._eventHandlers.mouseup, options);
7171

72-
document.body.removeChild(this._canvas);
72+
if (document.contains(this._canvas)) {
73+
document.body.removeChild(this._canvas);
74+
}
7375
}
7476

7577
this._target = null;

0 commit comments

Comments
 (0)