summaryrefslogtreecommitdiff
path: root/src/linux/up-device-supply-battery.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/linux/up-device-supply-battery.c')
-rw-r--r--src/linux/up-device-supply-battery.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/linux/up-device-supply-battery.c b/src/linux/up-device-supply-battery.c
index bef5857..f37c8a4 100644
--- a/src/linux/up-device-supply-battery.c
+++ b/src/linux/up-device-supply-battery.c
@@ -145,7 +145,9 @@ up_device_supply_battery_refresh (UpDevice *device,
* we can restrict this to updates other than UP_REFRESH_POLL.
* NOTE: Only energy.full and cycle_count can change for a battery.
*/
- info.present = g_udev_device_get_sysfs_attr_as_boolean_uncached (native, "present");
+ info.present = TRUE;
+ if (g_udev_device_has_sysfs_attr (native, "present"))
+ info.present = g_udev_device_get_sysfs_attr_as_boolean_uncached (native, "present");
if (!info.present) {
up_device_battery_update_info (battery, &info);
return TRUE;