From 01deb9ef7ddf1b8f14170483404dec3e3382587f Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Thu, 14 Mar 2013 13:25:12 +0100 Subject: [PATCH] status/keyboard: Check if this._currentSource is valid on activation this._currentSource might be invalid so check for that to prevent an exception and still switch to the newly activated source. https://bugzilla.gnome.org/show_bug.cgi?id=695841 --- js/ui/status/keyboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/ui/status/keyboard.js b/js/ui/status/keyboard.js index 4e629b107..3dc173b99 100644 --- a/js/ui/status/keyboard.js +++ b/js/ui/status/keyboard.js @@ -487,7 +487,7 @@ const InputSourceIndicator = new Lang.Class({ let is = new InputSource(type, id, displayName, shortName, i); is.connect('activate', Lang.bind(this, function() { - if (this._currentSource.index == is.index) + if (this._currentSource && this._currentSource.index == is.index) return; this._settings.set_value(KEY_CURRENT_INPUT_SOURCE, GLib.Variant.new_uint32(is.index));