]> sigrok.org Git - pulseview.git/commitdiff
Fix bug #392 by improving empty list/map handling
authorSoeren Apel <redacted>
Sun, 3 Aug 2014 12:12:12 +0000 (14:12 +0200)
committerBert Vermeulen <redacted>
Sun, 3 Aug 2014 12:20:46 +0000 (14:20 +0200)
pv/mainwindow.cpp
pv/popups/probes.cpp

index 1f683f19ecd2a8efc2d7f022776568c4aac47194..50cab695a8a87d850f4f2fda04f6b8f233ed8ee8 100644 (file)
@@ -282,6 +282,10 @@ void MainWindow::update_device_list()
 
        shared_ptr<pv::device::DevInst> selected_device = _session.get_device();
        list< shared_ptr<device::DevInst> > devices;
+
+       if (_device_manager.devices().size() == 0)
+               return;
+
        std::copy(_device_manager.devices().begin(),
                _device_manager.devices().end(), std::back_inserter(devices));
 
index f8fa970e0e7a7accff89b2ff4440e8a19ae45df4..fc069b8fd42761ef6ce5d6edda43d93e55d02dd8 100644 (file)
@@ -82,7 +82,9 @@ Probes::Probes(SigSession &session, QWidget *parent) :
                        assert(probe);
 
                        const auto iter = signal_map.find(probe);
-                       assert(iter != signal_map.end());
+
+                       if (iter == signal_map.end())
+                               break;
 
                        group_sigs.push_back((*iter).second);
                        signal_map.erase(iter);