From: Soeren Apel Date: Sun, 3 Aug 2014 12:12:12 +0000 (+0200) Subject: Fix bug #392 by improving empty list/map handling X-Git-Tag: pulseview-0.3.0~574 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=52a80eb3f81e1e4d8596164fe70d7ab8705d41eb;p=pulseview.git Fix bug #392 by improving empty list/map handling --- diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 1f683f19..50cab695 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -282,6 +282,10 @@ void MainWindow::update_device_list() shared_ptr selected_device = _session.get_device(); list< shared_ptr > devices; + + if (_device_manager.devices().size() == 0) + return; + std::copy(_device_manager.devices().begin(), _device_manager.devices().end(), std::back_inserter(devices)); diff --git a/pv/popups/probes.cpp b/pv/popups/probes.cpp index f8fa970e..fc069b8f 100644 --- a/pv/popups/probes.cpp +++ b/pv/popups/probes.cpp @@ -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);