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:
parent
82de16f92c
commit
95b015de38
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue