diff --git a/src/fu-main.c b/src/fu-main.c index 49a2281df..299458029 100644 --- a/src/fu-main.c +++ b/src/fu-main.c @@ -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);