From: Joel Holdsworth Date: Sat, 25 Jan 2014 11:13:33 +0000 (+0000) Subject: pv::prop::Enum: Do not create a widget if the initial value could not be retrieved X-Git-Tag: pulseview-0.2.0~113 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f352b9bbeafc33fab0d003573b86ceed17565b5e;p=pulseview.git pv::prop::Enum: Do not create a widget if the initial value could not be retrieved --- diff --git a/pv/prop/enum.cpp b/pv/prop/enum.cpp index d4a04cbb..9044c6ba 100644 --- a/pv/prop/enum.cpp +++ b/pv/prop/enum.cpp @@ -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++) {