keyboard: Check monitor validity before deferencing it

Monitor could be invalid in headless mode.

https://bugzilla.gnome.org/show_bug.cgi?id=788882
This commit is contained in:
Marco Trevisan (Treviño) 2018-04-18 08:08:54 +02:00
parent 19e864ed3b
commit 84d2d3feb3

View File

@ -1148,7 +1148,7 @@ var Keyboard = new Lang.Class({
let windowActor = window.get_compositor_private(); let windowActor = window.get_compositor_private();
let delta = 0; let delta = 0;
if (frameRect.y + y + h >= monitor.height - keyboardHeight) if (monitor && frameRect.y + y + h >= monitor.height - keyboardHeight)
delta = keyboardHeight; delta = keyboardHeight;
this._animateWindow(window, true, delta); this._animateWindow(window, true, delta);