diff options
-rw-r--r-- | src/linux/up-device-supply.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c index 48f5156..ec2514a 100644 --- a/src/linux/up-device-supply.c +++ b/src/linux/up-device-supply.c @@ -863,9 +863,9 @@ up_device_supply_coldplug (UpDevice *device) /* try to work out if the device is powering the system */ scope = g_udev_device_get_sysfs_attr (native, "scope"); - if (g_ascii_strcasecmp (scope, "device") == 0) { + if (scope != NULL && g_ascii_strcasecmp (scope, "device") == 0) { supply->priv->is_power_supply = FALSE; - } else if (g_ascii_strcasecmp (scope, "system") == 0) { + } else if (scope != NULL && g_ascii_strcasecmp (scope, "system") == 0) { supply->priv->is_power_supply = TRUE; } else { g_debug ("taking a guess for power supply scope"); |