Merge pull request #6 from novnc/master

Avoid exception when cursor was removed from DOM already
This commit is contained in:
Bad 2024-03-09 20:19:58 +02:00 committed by GitHub
commit d91d42281a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -69,8 +69,10 @@ export default class Cursor {
this._target.removeEventListener('mousemove', this._eventHandlers.mousemove, options);
this._target.removeEventListener('mouseup', this._eventHandlers.mouseup, options);
if (document.contains(this._canvas)) {
document.body.removeChild(this._canvas);
}
}
this._target = null;
}