hostnamed: prevent it from crashing if the chassis is unknown

When fallback_chassis would return null it led to a crash and an
empty result in hostnamectl. Only seen after the sd-port.
This commit is contained in:
Thomas Hindoe Paaboel Andersen 2013-11-06 00:30:29 +01:00
parent 82de16f92c
commit 95b015de38

View file

@ -360,6 +360,9 @@ static int property_get_chassis(
else
name = c->data[PROP_CHASSIS];
if(!name)
name = "";
r = sd_bus_message_append(reply, "s", name);
if (r < 0)
return r;