]> sigrok.org Git - pulseview.git/commitdiff
pv::prop::Enum: Do not create a widget if the initial value could not be retrieved
authorJoel Holdsworth <redacted>
Sat, 25 Jan 2014 11:13:33 +0000 (11:13 +0000)
committerBert Vermeulen <redacted>
Sat, 25 Jan 2014 11:54:10 +0000 (12:54 +0100)
pv/prop/enum.cpp

index d4a04cbb748ae066fb66cebe29b244eca52c6a8f..9044c6bae9d3c6335589c26e7be65835186a7b81 100644 (file)
@@ -51,6 +51,8 @@ QWidget* Enum::get_widget(QWidget *parent, bool auto_commit)
                return _selector;
 
        GVariant *const value = _getter ? _getter() : NULL;
+       if (!value)
+               return NULL;
 
        _selector = new QComboBox(parent);
        for (unsigned int i = 0; i < _values.size(); i++) {