aboutsummaryrefslogtreecommitdiff
path: root/src/device.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-06-01 13:43:40 -0500
committerCharles Kerr <charles.kerr@canonical.com>2012-06-01 13:43:40 -0500
commit5b17593fb388ab9febc2e4bc26d8054a34dd58c0 (patch)
tree280c1ff12f8207d255f1ec27f1ad49c284feeec6 /src/device.c
parent4c433bf6980f43c5fca5d7c86b167f50cc0295fd (diff)
downloadayatana-indicator-power-5b17593fb388ab9febc2e4bc26d8054a34dd58c0.tar.gz
ayatana-indicator-power-5b17593fb388ab9febc2e4bc26d8054a34dd58c0.tar.bz2
ayatana-indicator-power-5b17593fb388ab9febc2e4bc26d8054a34dd58c0.zip
Fix edge case in indicator_power_device_get_icon_names() that returned a bad value if the caller passed in a NULL pointer as a device. Added regression test.
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/device.c b/src/device.c
index ac03009..b163682 100644
--- a/src/device.c
+++ b/src/device.c
@@ -307,7 +307,7 @@ indicator_power_device_get_icon_names (const IndicatorPowerDevice * device)
const gchar *index_str;
/* LCOV_EXCL_START */
- g_return_val_if_fail (INDICATOR_IS_POWER_DEVICE(device), UP_DEVICE_KIND_UNKNOWN);
+ g_return_val_if_fail (INDICATOR_IS_POWER_DEVICE(device), NULL);
/* LCOV_EXCL_STOP */
gdouble percentage = indicator_power_device_get_percentage (device);