Commit 8e0e6ad4 authored by THIBAULT Samuel's avatar THIBAULT Samuel

avoid crash when doing stats on states which don't have a container

parent fb5d3cd4
......@@ -205,14 +205,17 @@ void Stats_window::set_selected_nodes(string kind_of_state){
// We fill the new selected containers
// TODO : Use the tree instead of the list
QTreeWidgetItemIterator it(_nodes_selected);
while (*it) {
for (; *it; it++) {
if ((*it)->checkState(0) == Qt::Checked){
Container *cont = _trace->search_container((*it)->text(0).toStdString());
if (!cont) {
cout << "didn't find container " << (*it)->text(0).toStdString() << endl;
continue;
}
//cout << ((ContainerType *)cont->get_type())->get_name().to_string() << " " << ((ContainerType *)kind_of_container)->get_name().to_string() << endl;
if (cont->get_type() == kind_of_container)
_selected_containers.push_back(cont);
}
it ++;
}
_number_of_selected_container = _selected_containers.size();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment