fix gdbus error message
authorYoungjae Shin <yj99.shin@samsung.com>
Fri, 27 Mar 2020 06:34:37 +0000 (15:34 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Mon, 30 Mar 2020 08:17:34 +0000 (17:17 +0900)
client/mdsc_register_mode.c
common/dbus_def.h

index 15826bc..e630063 100644 (file)
@@ -73,8 +73,8 @@ static GVariant* _mdsc_create_mode_data(modes_mode_h mode)
 
        while (NULL != it) {
                struct mds_action_handle *action_data = (struct mds_action_handle *)it->data;
-               g_variant_builder_add(action_builder, MODES_DBUS_ACTION_SIG, action_data->id,
-                               action_data->rule, action_data->value);
+               g_variant_builder_add(action_builder, MODES_DBUS_ACTION_SIG, MODES_DBUS_SAFE_STR(action_data->id),
+                       MODES_DBUS_SAFE_STR(action_data->rule), MODES_DBUS_SAFE_STR(action_data->value));
                it = g_list_next(it);
        }
 
index ae922bb..21486ef 100644 (file)
@@ -28,3 +28,5 @@
 
 #define MODES_DBUS_GET_MODES_MODE_SIG "(sii)"
 #define MODES_DBUS_GET_MODES_SIG "a" MODES_DBUS_GET_MODES_MODE_SIG
+
+#define MODES_DBUS_SAFE_STR(x) x ? x : ""