mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-14 08:39:20 +00:00
trivial: Fix critical warning when running fwupd as non-root
This commit is contained in:
parent
1a328fd3ad
commit
3ba0b29ba3
@ -454,7 +454,10 @@ const gchar *
|
||||
fu_context_lookup_quirk_by_id (FuContext *self, const gchar *guid, const gchar *key)
|
||||
{
|
||||
FuContextPrivate *priv = GET_PRIVATE (self);
|
||||
|
||||
g_return_val_if_fail (FU_IS_CONTEXT (self), NULL);
|
||||
g_return_val_if_fail (guid != NULL, NULL);
|
||||
g_return_val_if_fail (key != NULL, NULL);
|
||||
|
||||
/* exact ID */
|
||||
return fu_quirks_lookup_by_id (priv->quirks, guid, key);
|
||||
|
@ -113,9 +113,11 @@ fu_plugin_startup (FuPlugin *plugin, GError **error)
|
||||
const gchar *vendor = fu_context_get_hwid_replace_value (ctx,
|
||||
FU_HWIDS_KEY_MANUFACTURER,
|
||||
NULL);
|
||||
battery_str = g_strdup (fu_context_lookup_quirk_by_id (ctx,
|
||||
vendor,
|
||||
FU_QUIRKS_BATTERY_THRESHOLD));
|
||||
if (vendor != NULL) {
|
||||
battery_str = g_strdup (fu_context_lookup_quirk_by_id (ctx,
|
||||
vendor,
|
||||
FU_QUIRKS_BATTERY_THRESHOLD));
|
||||
}
|
||||
}
|
||||
if (battery_str == NULL)
|
||||
minimum_battery = MINIMUM_BATTERY_PERCENTAGE_FALLBACK;
|
||||
|
Loading…
Reference in New Issue
Block a user