Make sure showDotCursor can be modified before connecting

The cursor object is only attached to our canvas whilst connecting,
so we need to make sure we don't try to update anything when were
not connected or we'll get a crash.
This commit is contained in:
Pierre Ossman 2019-08-23 13:57:30 +02:00
parent e1d50c8c10
commit 1f2bb52850
1 changed files with 1 additions and 0 deletions

View File

@ -1699,6 +1699,7 @@ export default class RFB extends EventTargetMixin {
} }
_refreshCursor() { _refreshCursor() {
if (this._rfb_connection_state !== 'connected') { return; }
const image = this._shouldShowDotCursor() ? RFB.cursors.dot : this._cursorImage; const image = this._shouldShowDotCursor() ? RFB.cursors.dot : this._cursorImage;
this._cursor.change(image.rgbaPixels, this._cursor.change(image.rgbaPixels,
image.hotx, image.hoty, image.hotx, image.hoty,