trivial: Fix a critical warning if compiled without HSI support

This commit is contained in:
Richard Hughes 2021-11-29 14:35:01 +00:00
parent 03f8238cf8
commit c9e58e2cd9

View File

@ -1820,8 +1820,18 @@ fu_main_daemon_get_property(GDBusConnection *connection_,
return g_variant_new_string(tmp);
}
if (g_strcmp0(property_name, "HostSecurityId") == 0)
return g_variant_new_string(fu_engine_get_host_security_id(priv->engine));
if (g_strcmp0(property_name, "HostSecurityId") == 0) {
const gchar *tmp = fu_engine_get_host_security_id(priv->engine);
if (tmp == NULL) {
g_set_error(error,
G_DBUS_ERROR,
G_DBUS_ERROR_NOT_SUPPORTED,
"failed to get daemon property %s",
property_name);
return NULL;
}
return g_variant_new_string(tmp);
}
if (g_strcmp0(property_name, "Interactive") == 0)
return g_variant_new_boolean(isatty(fileno(stdout)) != 0);