summaryrefslogtreecommitdiff
path: root/src/linux/up-device-supply.c
diff options
context:
space:
mode:
authorTimothée Ravier <siosm99@gmail.com>2013-08-25 00:41:41 +0200
committerMartin Pitt <martinpitt@gnome.org>2013-08-26 15:02:52 +0200
commit6d3a68d7d4a737b2d79fb93547707b7c715aae2d (patch)
tree4ef633f62cd538a3d672f6e5a37d606852a69cfa /src/linux/up-device-supply.c
parent9b142071d33831721da9553c9a230b126aeb2a1d (diff)
downloadupower-6d3a68d7d4a737b2d79fb93547707b7c715aae2d.tar.gz
Linux: Fix warning in up_device_supply_get_design_voltage
This avoids filling the logs with the unnecessary warning line: GLib-CRITICAL **: g_ascii_strcasecmp: assertion `s1 != NULL' failed as seen in https://bugzilla.redhat.com/show_bug.cgi?id=847874 and https://bugzilla.redhat.com/show_bug.cgi?id=863524 Signed-off-by: Martin Pitt <martinpitt@gnome.org>
Diffstat (limited to 'src/linux/up-device-supply.c')
-rw-r--r--src/linux/up-device-supply.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c
index 68f3537..a29649f 100644
--- a/src/linux/up-device-supply.c
+++ b/src/linux/up-device-supply.c
@@ -407,7 +407,7 @@ up_device_supply_get_design_voltage (const gchar *native_path)
/* is this a USB device? */
device_type = up_device_supply_get_string (native_path, "type");
- if (g_ascii_strcasecmp (device_type, "USB") == 0) {
+ if (device_type != NULL && g_ascii_strcasecmp (device_type, "USB") == 0) {
g_debug ("USB device, so assuming 5v");
voltage = 5.0f;
goto out;