From 1e1b3a668e6f3462d45c2047484dc1b86f41da51 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Mon, 6 Apr 2015 10:08:40 +0100 Subject: [PATCH] binding::Device: Catch errors listing the config keys --- pv/binding/device.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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; -- 2.30.2