[gnome-online-accounts] daemon: Assert that the callbacks have sane arguments



commit 7890b3401fce1d40939d1cfed0c0e7d62e0d052a
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Jul 3 17:25:17 2017 +0200

    daemon: Assert that the callbacks have sane arguments

 src/daemon/main.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/daemon/main.c b/src/daemon/main.c
index 6e9d549..1ce838e 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -55,6 +55,9 @@ on_name_lost (GDBusConnection *connection,
               const gchar     *name,
               gpointer         user_data)
 {
+  g_return_if_fail (connection == NULL || G_IS_DBUS_CONNECTION (connection));
+  g_return_if_fail (name != NULL && name[0] != '\0');
+
   g_info ("Lost (or failed to acquire) the name %s on the session message bus", name);
   g_main_loop_quit (loop);
 }
@@ -64,6 +67,9 @@ on_name_acquired (GDBusConnection *connection,
                   const gchar     *name,
                   gpointer         user_data)
 {
+  g_return_if_fail (G_IS_DBUS_CONNECTION (connection));
+  g_return_if_fail (name != NULL && name[0] != '\0');
+
   g_debug ("Acquired the name %s on the session message bus", name);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]