diff --git a/js/misc/inputMethod.js b/js/misc/inputMethod.js index d944c2978..9f1659758 100644 --- a/js/misc/inputMethod.js +++ b/js/misc/inputMethod.js @@ -380,9 +380,11 @@ export const InputMethod = GObject.registerClass({ return; this._updateCapabilities(); this._context.set_content_type(this._purpose, this._hints); - this._context.set_cursor_location( - this._cursorRect.x, this._cursorRect.y, - this._cursorRect.width, this._cursorRect.height); + if (this._cursorRect) { + this._context.set_cursor_location( + this._cursorRect.x, this._cursorRect.y, + this._cursorRect.width, this._cursorRect.height); + } this._emitRequestSurrounding(); } });