From 4fc15b4ee838ea3e09279d0922bfef6ad6c5f2a1 Mon Sep 17 00:00:00 2001 From: Kichan Kwon Date: Tue, 30 Jan 2018 14:42:35 +0900 Subject: [PATCH] Print GDBus error message only if exist Change-Id: If8fa90257263bfae969dd982e8e516080dc7a5ba Signed-off-by: Kichan Kwon --- src/runtime_info_usage.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/runtime_info_usage.c b/src/runtime_info_usage.c index 2137a1a..ff04310 100644 --- a/src/runtime_info_usage.c +++ b/src/runtime_info_usage.c @@ -150,7 +150,8 @@ static GVariant *runtime_info_dbus_request_usage_info(runtime_info_usage_type_e conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err); if (!conn) { //LCOV_EXCL_START : system error - _E("Failed to get dbus connection : %s", err->message); + _E("Failed to get dbus connection : %s", + err && err->message ? err->message : NULL); if (args_in) g_variant_unref(args_in); return NULL; @@ -169,7 +170,8 @@ static GVariant *runtime_info_dbus_request_usage_info(runtime_info_usage_type_e args_in, NULL, G_DBUS_CALL_FLAGS_NONE, DBUS_REPLY_TIMEOUT, NULL, &err); if (!args_out) { //LCOV_EXCL_START : system error - _E("DBUS_METHOD_CALL: not able to send message : %s", err->message); + _E("DBUS_METHOD_CALL: not able to send message : %s", + err && err->message ? err->message : NULL); if (err->code == G_FILE_ERROR_TXTBSY) *error = RUNTIME_INFO_ERROR_PERMISSION_DENIED; else -- 2.7.4