From: Joel Holdsworth Date: Mon, 6 Apr 2015 09:08:40 +0000 (+0100) Subject: binding::Device: Catch errors listing the config keys X-Git-Tag: pulseview-0.3.0~210 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=1e1b3a668e6f3462d45c2047484dc1b86f41da51 binding::Device: Catch errors listing the config keys --- diff --git a/pv/binding/device.cpp b/pv/binding/device.cpp index 32edea16..6f978893 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;