From f1c4fcb0e0cd7427999c5c97e47d85a60544a4be Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Tue, 2 Nov 2010 20:30:02 +0900 Subject: [PATCH] Fix crash when icon of property is Null --- bus/factoryproxy.c | 3 ++- src/ibusproperty.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bus/factoryproxy.c b/bus/factoryproxy.c index f4e739d..130b881 100644 --- a/bus/factoryproxy.c +++ b/bus/factoryproxy.c @@ -176,7 +176,8 @@ bus_factory_proxy_create_engine (BusFactoryProxy *factory, g_variant_get (retval, "(&o)", &object_path); GDBusConnection *connection = g_dbus_proxy_get_connection ((GDBusProxy *) factory); BusEngineProxy *engine = bus_engine_proxy_new (object_path, - desc, bus_connection_lookup (connection)); + desc, + bus_connection_lookup (connection)); g_variant_unref (retval); return engine; } diff --git a/src/ibusproperty.c b/src/ibusproperty.c index 52a8210..bb9cc21 100644 --- a/src/ibusproperty.c +++ b/src/ibusproperty.c @@ -243,7 +243,7 @@ ibus_property_set_icon (IBusProperty *prop, g_assert (IBUS_IS_PROPERTY (prop)); g_free (prop->icon); - prop->icon = g_strdup (icon); + prop->icon = g_strdup (icon != NULL ? icon : ""); } void -- 2.7.4