X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fbinding%2Fdevice.cpp;h=77c772c088b07dabcbba1ed782339560527dae09;hp=32edea164144786d0ef9ad8aeab525dc99363eb8;hb=2ad82c2e40b6865481733913a2c32735602f63c4;hpb=198f9bc74d6c955a72e3e3282c2b0ba16ef39a62 diff --git a/pv/binding/device.cpp b/pv/binding/device.cpp index 32edea1..77c772c 100644 --- a/pv/binding/device.cpp +++ b/pv/binding/device.cpp @@ -56,9 +56,15 @@ namespace binding { Device::Device(shared_ptr configurable) : configurable_(configurable) { - assert(configurable); + std::map< const ConfigKey*, std::set > keys; - for (auto entry : configurable->config_keys(ConfigKey::DEVICE_OPTIONS)) { + try { + keys = configurable->config_keys(ConfigKey::DEVICE_OPTIONS); + } catch (const Error) { + return; + } + + for (auto entry : keys) { auto key = entry.first; auto capabilities = entry.second; @@ -82,8 +88,7 @@ Device::Device(shared_ptr configurable) : config_changed(); }; - switch (key->id()) - { + switch (key->id()) { case SR_CONF_SAMPLERATE: // Sample rate values are not bound because they are shown // in the MainBar