[gnome-power-manager] Ensure parameters to g_variant_new are not NULL



commit 15cd73ccb3b70012572beea3cbc9a961393d0d58
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sun Nov 7 20:37:04 2010 +0100

    Ensure parameters to g_variant_new are not NULL
    
    g_variant_new cannot handle NULL parameters. Use an empty string in
    that case.

 src/gpm-main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/gpm-main.c b/src/gpm-main.c
index 19acf8c..280ca93 100644
--- a/src/gpm-main.c
+++ b/src/gpm-main.c
@@ -74,7 +74,7 @@ gpm_main_session_end_session_response (gboolean is_okay, const gchar *reason)
 					 "EndSessionResponse",
 					 g_variant_new ("(bs)",
 							is_okay,
-							reason),
+							reason != NULL ? reason : ""),
 					 G_DBUS_CALL_FLAGS_NONE,
 					 -1, NULL, &error);
 	if (retval == NULL) {



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