summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Huang <shawn.p.huang@gmail.com>2011-10-26 11:15:36 -0400
committerPeng Huang <shawn.p.huang@gmail.com>2011-10-26 11:15:36 -0400
commitf736b49d4e0e424bf8fd2ef1786bec4539a066eb (patch)
tree7a38748a25abfb1810965ce6bfe7aaf9bd77d78a
parentcb5afea67473240d73f0c359c7dc6e553f87da14 (diff)
downloadibus-pinyin-f736b49d4e0e424bf8fd2ef1786bec4539a066eb.tar.gz
Exit if config component is not ready instead of crash.
BUG=crash when ibus config is not ready TEST=Linux desktop Review URL: http://codereview.appspot.com/5321054
-rw-r--r--src/PYMain.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/PYMain.cc b/src/PYMain.cc
index 021201f..f786b70 100644
--- a/src/PYMain.cc
+++ b/src/PYMain.cc
@@ -76,7 +76,12 @@ start_component (void)
Bus bus;
if (!bus.isConnected ()) {
- g_warning ("Can not connect to ibus");
+ g_warning ("Can not connect to ibus!");
+ exit (0);
+ }
+
+ if (!ibus_bus_get_config (bus)) {
+ g_warning ("IBus config component is not ready!");
exit (0);
}