summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2008-08-10 08:46:09 +0100
committerRichard Hughes <richard@hughsie.com>2008-08-10 08:46:09 +0100
commitbae6018698fe6d16d8f9e4c32f413125d237304d (patch)
tree2da48dfa63f4bf0f58a79a446f8b59e6262ecb87 /src
parent918c35586bf257d316b0dfc6c0822a9c9c142f17 (diff)
don't try to access klass->get_stats() if it's not set
Diffstat (limited to 'src')
-rw-r--r--src/dkp-device.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dkp-device.c b/src/dkp-device.c
index a76829e..809aa48 100644
--- a/src/dkp-device.c
+++ b/src/dkp-device.c
@@ -291,6 +291,13 @@ dkp_device_get_statistics (DkpDevice *device, const gchar *type, guint timespan,
GValue *value;
guint i;
+ /* doesn't even try to support this */
+ if (klass->get_stats == NULL) {
+ error = g_error_new (DKP_DAEMON_ERROR, DKP_DAEMON_ERROR_GENERAL, "device does not support getting stats");
+ dbus_g_method_return_error (context, error);
+ goto out;
+ }
+
array = klass->get_stats (device, type, timespan);
/* maybe the device doesn't support histories */
if (array == NULL) {