File: stats-crash

package info (click to toggle)
vite 1.2%2Bsvn1430-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 20,164 kB
  • ctags: 3,915
  • sloc: cpp: 26,903; makefile: 455; sh: 111; ansic: 67
file content (22 lines) | stat: -rw-r--r-- 941 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- a/src/statistics/Stats_window.cpp
+++ b/src/statistics/Stats_window.cpp
@@ -205,14 +205,17 @@ void Stats_window::set_selected_nodes(st
     // 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();