From: Joel Holdsworth Date: Sun, 23 Mar 2014 14:24:58 +0000 (+0000) Subject: DeviceOptions: Added an error handler for the case when a device exposes an enum... X-Git-Tag: pulseview-0.2.0~8 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=48c8844588e204568a7ae58abe0fb2070cd56d77 DeviceOptions: Added an error handler for the case when a device exposes an enum with no values list --- 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)))