From: Joel Holdsworth Date: Mon, 6 Apr 2015 09:11:59 +0000 (+0100) Subject: Session: Catch errors listing the config keys X-Git-Tag: pulseview-0.3.0~209 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=30d6f09f5eec0fb18d5c87347b5de6124a56a63c;p=pulseview.git Session: Catch errors listing the config keys --- diff --git a/pv/session.cpp b/pv/session.cpp index d5126660..2cdc25f8 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -400,7 +400,12 @@ shared_ptr Session::signal_from_channel( void Session::read_sample_rate(shared_ptr device) { assert(device); - const auto keys = device->config_keys(ConfigKey::DEVICE_OPTIONS); + map< const ConfigKey*, set > keys; + + try { + keys = device->config_keys(ConfigKey::DEVICE_OPTIONS); + } catch (const Error) {} + const auto iter = keys.find(ConfigKey::SAMPLERATE); cur_samplerate_ = (iter != keys.end() && (*iter).second.find(sigrok::GET) != (*iter).second.end()) ?