chiark / gitweb /
bus: NULL signatures are OK too
authorLennart Poettering <lennart@poettering.net>
Tue, 22 Oct 2013 11:40:54 +0000 (12:40 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 22 Oct 2013 11:41:54 +0000 (12:41 +0100)
src/libsystemd-bus/bus-objects.c

index 90417fd..c852ad6 100644 (file)
@@ -333,14 +333,13 @@ static int invoke_property_get(
         switch (v->x.property.signature[0]) {
 
         case SD_BUS_TYPE_STRING:
-                p = *(char**) userdata;
-                if (!p)
-                        p = "";
+        case SD_BUS_TYPE_SIGNATURE:
+                p = strempty(*(char**) userdata);
                 break;
 
         case SD_BUS_TYPE_OBJECT_PATH:
-        case SD_BUS_TYPE_SIGNATURE:
                 p = *(char**) userdata;
+                assert(p);
                 break;
 
         default: