]> sigrok.org Git - pulseview.git/commitdiff
MainBar: Catch errors listing the config keys
authorJoel Holdsworth <redacted>
Mon, 6 Apr 2015 09:06:34 +0000 (10:06 +0100)
committerUwe Hermann <redacted>
Thu, 11 Jun 2015 18:38:47 +0000 (20:38 +0200)
pv/toolbars/mainbar.cpp

index 68f36ba367a7720eabd367d20e68f2bcfa2297c5..9c5049dd8aa92d291e9c8b0e5b1e92b823685262 100644 (file)
@@ -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<Capability> > keys;
 
        if (updating_sample_rate_)
                return;
@@ -229,7 +230,11 @@ void MainBar::update_sample_rate_selector()
        updating_sample_rate_ = true;
 
        const shared_ptr<sigrok::Device> 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()) {