aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/device.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c
index 1c818cc..ce24520 100644
--- a/src/device.c
+++ b/src/device.c
@@ -640,6 +640,10 @@ indicator_power_device_new (const gchar * object_path,
IndicatorPowerDevice *
indicator_power_device_new_from_variant (GVariant * v)
{
+ g_return_val_if_fail (v != NULL, NULL);
+ g_return_val_if_fail (g_variant_type_is_tuple(g_variant_get_type(v)), NULL);
+ g_return_val_if_fail (g_variant_n_children(v) == 6, NULL);
+
UpDeviceKind kind = UP_DEVICE_KIND_UNKNOWN;
UpDeviceState state = UP_DEVICE_STATE_UNKNOWN;
const gchar * icon = NULL;