[libdazzle] properties-group: add fallback for NULL



commit d1ae3faedac28ce962b8615d5f866b5444a7f42d
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jul 11 22:50:09 2017 -0700

    properties-group: add fallback for NULL
    
    We need to special case NULL, and I don't really have a better
    way to deal with this at the moment. We could potentially make
    strings a maybe-type but that complicates other things, I think.

 src/actions/dzl-properties-group.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/actions/dzl-properties-group.c b/src/actions/dzl-properties-group.c
index 5c92751..98045ae 100644
--- a/src/actions/dzl-properties-group.c
+++ b/src/actions/dzl-properties-group.c
@@ -120,7 +120,10 @@ get_action_state (GObject       *object,
       break;
 
     case G_TYPE_STRING:
-      ret = g_variant_new_string (g_value_get_string (&value));
+      if (!g_value_get_string (&value))
+        ret = g_variant_new_string ("");
+      else
+        ret = g_variant_new_string (g_value_get_string (&value));
       break;
 
     case G_TYPE_BOOLEAN:


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