mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-15 04:08:08 +02:00
don't return an ID if we are not present
This commit is contained in:
parent
d85c495674
commit
0e4418ca30
1 changed files with 4 additions and 0 deletions
|
|
@ -556,6 +556,10 @@ devkit_power_source_get_id (DevkitPowerSource *source)
|
|||
if (source->priv->type != DEVKIT_POWER_TYPE_BATTERY)
|
||||
return id;
|
||||
|
||||
/* we don't have an ID if we are not present */
|
||||
if (!source->priv->battery_is_present)
|
||||
return id;
|
||||
|
||||
string = g_string_new ("");
|
||||
|
||||
/* in an ideal world, model-capacity-serial */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue