[gnome-shell] keyboard: Fix a warning
- From: Florian MÃllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] keyboard: Fix a warning
- Date: Fri, 1 Feb 2013 12:07:11 +0000 (UTC)
commit 65bf0d20e74bd5972e19341561f2c79ba77d1ea9
Author: Florian MÃllner <fmuellner gnome org>
Date: Fri Feb 1 01:22:15 2013 +0100
keyboard: Fix a warning
While we handle the case where ibus_bus_get_global_engine() returns
NULL, this case actually generates an exception we have to catch to
avoid some (harmless) console spam.
https://bugzilla.gnome.org/show_bug.cgi?id=692995
js/ui/status/keyboard.js | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/status/keyboard.js b/js/ui/status/keyboard.js
index f091418..15e14d8 100644
--- a/js/ui/status/keyboard.js
+++ b/js/ui/status/keyboard.js
@@ -115,9 +115,14 @@ const IBusManager = new Lang.Class({
this._panelService.connect('update-property', Lang.bind(this, this._updateProperty));
// If an engine is already active we need to get its properties
this._ibus.get_global_engine_async(-1, null, Lang.bind(this, function(i, result) {
- let engine = this._ibus.get_global_engine_async_finish(result);
- if (!engine)
+ let engine;
+ try {
+ engine = this._ibus.get_global_engine_async_finish(result);
+ if (!engine)
+ return;
+ } catch(e) {
return;
+ }
this._engineChanged(this._ibus, engine.get_name());
}));
this._updateReadiness();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]