From 48c8844588e204568a7ae58abe0fb2070cd56d77 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sun, 23 Mar 2014 14:24:58 +0000 Subject: [PATCH] DeviceOptions: Added an error handler for the case when a device exposes an enum with no values list --- pv/prop/binding/deviceoptions.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pv/prop/binding/deviceoptions.cpp b/pv/prop/binding/deviceoptions.cpp index 863c19c0..2dc237a8 100644 --- a/pv/prop/binding/deviceoptions.cpp +++ b/pv/prop/binding/deviceoptions.cpp @@ -22,6 +22,8 @@ #include +#include + #include "deviceoptions.h" #include @@ -135,7 +137,11 @@ void DeviceOptions::bind_enum(const QString &name, int key, vector< pair > values; assert(_dev_inst); - assert(gvar_list); + if (!gvar_list) { + qDebug() << "Config key " << key << " was listed, but no " + "options were given"; + return; + } g_variant_iter_init (&iter, gvar_list); while ((gvar = g_variant_iter_next_value (&iter))) -- 2.30.2