From 0e4418ca3035a9aee7efc2237858ddce4832a6b2 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Fri, 25 Jul 2008 19:04:23 +0100 Subject: [PATCH] don't return an ID if we are not present --- src/devkit-power-source.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/devkit-power-source.c b/src/devkit-power-source.c index c9aa1fc..caaa8ff 100644 --- a/src/devkit-power-source.c +++ b/src/devkit-power-source.c @@ -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 */