]> sigrok.org Git - pulseview.git/commitdiff
DeviceOptions: Added an error handler for the case when a device exposes an enum...
authorJoel Holdsworth <redacted>
Sun, 23 Mar 2014 14:24:58 +0000 (14:24 +0000)
committerBert Vermeulen <redacted>
Thu, 27 Mar 2014 09:57:33 +0000 (10:57 +0100)
pv/prop/binding/deviceoptions.cpp

index 863c19c00a66e2c0e82edadbfee45384366a6331..2dc237a885ec6eec83f9efbdde0654ef0aa9b049 100644 (file)
@@ -22,6 +22,8 @@
 
 #include <stdint.h>
 
+#include <QDebug>
+
 #include "deviceoptions.h"
 
 #include <pv/device/devinst.h>
@@ -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)))