Fix crash when icon of property is Null
authorPeng Huang <shawn.p.huang@gmail.com>
Tue, 2 Nov 2010 11:30:02 +0000 (20:30 +0900)
committerPeng Huang <shawn.p.huang@gmail.com>
Wed, 3 Nov 2010 01:54:59 +0000 (10:54 +0900)
bus/factoryproxy.c
src/ibusproperty.c

index f4e739d342713875d79f39eb36ac61c2cbf341a7..130b8812382b4c381448412ba97d005869b6d320 100644 (file)
@@ -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;
 }
index 52a82109f1796037826dad4f64d3e1a618871e3f..bb9cc218eeca62620cd9ce54d84f443c593eb254 100644 (file)
@@ -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