[gnome-online-accounts] daemon: Remove redundant NULL check and be more assertive
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts] daemon: Remove redundant NULL check and be more assertive
- Date: Fri, 14 Jul 2017 10:48:18 +0000 (UTC)
commit d2fb8d80914a4765ca37fb9494c4a3a4e2251b2a
Author: Debarshi Ray <debarshir gnome org>
Date: Mon Jul 3 17:29:15 2017 +0200
daemon: Remove redundant NULL check and be more assertive
A GBusAcquiredCallback can never have a NULL GDBusConnection. This is a
good opportunity to also sanity check the name.
src/daemon/main.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/daemon/main.c b/src/daemon/main.c
index 1ce838e..9f9ac8f 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -45,8 +45,10 @@ on_bus_acquired (GDBusConnection *connection,
const gchar *name,
gpointer user_data)
{
- if (connection != NULL)
- the_daemon = goa_daemon_new (connection);
+ g_return_if_fail (G_IS_DBUS_CONNECTION (connection));
+ g_return_if_fail (name != NULL && name[0] != '\0');
+
+ the_daemon = goa_daemon_new (connection);
g_debug ("Connected to the session bus");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]