chiark / gitweb /
dbus: don't call bus_path_escape() with NULL unit name
[elogind.git] / src / unit.c
index 840c1d1fc450556e56ce79b87045b1980eece2d0..dd665e2d5a0bfc321282e08678183bc13b278ee9 100644 (file)
@@ -1551,6 +1551,9 @@ char *unit_dbus_path(Unit *u) {
 
         assert(u);
 
+        if (!u->meta.id)
+                return NULL;
+
         if (!(e = bus_path_escape(u->meta.id)))
                 return NULL;