]> sigrok.org Git - pulseview.git/blobdiff - pv/prop/binding/deviceoptions.cpp
DeviceOptions: Added an error handler for the case when a device exposes an enum...
[pulseview.git] / pv / prop / binding / deviceoptions.cpp
index 26d4ef2a8fabe72dd3047525ca7e7c22112f0e99..2dc237a885ec6eec83f9efbdde0654ef0aa9b049 100644 (file)
@@ -22,6 +22,8 @@
 
 #include <stdint.h>
 
+#include <QDebug>
+
 #include "deviceoptions.h"
 
 #include <pv/device/devinst.h>
@@ -46,7 +48,7 @@ namespace prop {
 namespace binding {
 
 DeviceOptions::DeviceOptions(shared_ptr<pv::device::DevInst> dev_inst,
-       const sr_probe_group *group) :
+       const sr_channel_group *group) :
        _dev_inst(dev_inst),
        _group(group)
 {
@@ -135,7 +137,11 @@ void DeviceOptions::bind_enum(const QString &name, int key,
        vector< pair<GVariant*, QString> > 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)))