From: Joel Holdsworth Date: Mon, 6 Apr 2015 09:06:34 +0000 (+0100) Subject: MainBar: Catch errors listing the config keys X-Git-Tag: pulseview-0.3.0~211 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=a6ed12bfdfe8588565456d04824011c66863914c;p=pulseview.git MainBar: Catch errors listing the config keys --- diff --git a/pv/toolbars/mainbar.cpp b/pv/toolbars/mainbar.cpp index 68f36ba3..9c5049dd 100644 --- a/pv/toolbars/mainbar.cpp +++ b/pv/toolbars/mainbar.cpp @@ -216,6 +216,7 @@ void MainBar::update_sample_rate_selector() GVariant *gvar_list; const uint64_t *elements = NULL; gsize num_elements; + map< const ConfigKey*, std::set > keys; if (updating_sample_rate_) return; @@ -229,7 +230,11 @@ void MainBar::update_sample_rate_selector() updating_sample_rate_ = true; const shared_ptr sr_dev = device->device(); - const auto keys = sr_dev->config_keys(ConfigKey::DEVICE_OPTIONS); + + try { + keys = sr_dev->config_keys(ConfigKey::DEVICE_OPTIONS); + } catch (Error) {} + const auto iter = keys.find(ConfigKey::SAMPLERATE); if (iter != keys.end() && (*iter).second.find(sigrok::LIST) != (*iter).second.end()) {