From: SukhyungKang Date: Thu, 1 Feb 2024 04:00:09 +0000 (+0900) Subject: Fix null reference case X-Git-Tag: accepted/tizen/unified/20240205.162738~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ef9a3494ff712f465cc4df10fa9d406fac3effe;p=platform%2Fcore%2Fapi%2Fnotification.git Fix null reference case Change-Id: Icfcb8eda97140255d5fdee480e53909b50aa7e2f Signed-off-by: SukhyungKang --- diff --git a/notification-ex/dbus_sender.cc b/notification-ex/dbus_sender.cc index 9d9318e0..1396ed9d 100644 --- a/notification-ex/dbus_sender.cc +++ b/notification-ex/dbus_sender.cc @@ -70,19 +70,25 @@ void DBusSender::Impl::EmitSignal(string bus_name, string signal_name, DBusConnectionManager::GetInst().GetInterfaceName().c_str(), signal_name.c_str(), data, &err); if (result == FALSE) { + int err_code = ERROR_IO_ERROR; LOGE("g_dbus_connection_emit_signal() is failed. error(%s)", err ? err->message : "Unknown"); - int err_code = util::ConvertDBusError(err->code); - g_clear_error(&err); + if (err) { + err_code = util::ConvertDBusError(err->code); + g_clear_error(&err); + } THROW(err_code); } result = g_dbus_connection_flush_sync(conn, NULL, &err); if (result == FALSE) { + int err_code = ERROR_IO_ERROR; LOGE("g_dbus_connection_flush_sync() is failed. error(%s)", err ? err->message : "Unknown"); - int err_code = util::ConvertDBusError(err->code); - g_clear_error(&err); + if (err) { + err_code = util::ConvertDBusError(err->code); + g_clear_error(&err); + } THROW(err_code); } LOGI("Successfully emit signal to %s, %s, %s",