From 50ceef360174ab6709a4215706ea527735f10c7e Mon Sep 17 00:00:00 2001 From: Yusuke Sato Date: Mon, 29 Nov 2010 12:04:27 +0900 Subject: [PATCH] Do not call g_critical when ibus->config is NULL since it's not an error. The change is originally for chromeos branch of ibus (http://codereview.appspot.com/3304043/) but I believe this is also good for the master branch of ibus. BUG=none TEST=manually Review URL: http://codereview.appspot.com/3269043 --- bus/ibusimpl.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c index b045d7f..d7e496d 100644 --- a/bus/ibusimpl.c +++ b/bus/ibusimpl.c @@ -1937,7 +1937,11 @@ static gchar* bus_ibus_impl_load_global_engine_name_from_config (BusIBusImpl *ibus) { g_assert (BUS_IS_IBUS_IMPL (ibus)); - g_return_val_if_fail (IBUS_IS_CONFIG (ibus->config), NULL); + if (ibus->config == NULL) { + /* the config component is not started yet. */ + return NULL; + } + g_assert (IBUS_IS_CONFIG (ibus->config)); GVariant *variant = ibus_config_get_value (ibus->config, "general", "global_engine"); gchar *engine_name = NULL; @@ -1976,7 +1980,11 @@ static gchar* bus_ibus_impl_load_global_previous_engine_name_from_config (BusIBusImpl *ibus) { g_assert (BUS_IS_IBUS_IMPL (ibus)); - g_return_val_if_fail (IBUS_IS_CONFIG (ibus->config), NULL); + if (ibus->config == NULL) { + /* the config component is not started yet. */ + return NULL; + } + g_assert (IBUS_IS_CONFIG (ibus->config)); GVariant *value = ibus_config_get_value (ibus->config, "general", "global_previous_engine"); if (value == NULL) -- 2.7.4