potential fix for #7110 (older sessions have no id)
authorRobin Gareus <robin@gareus.org>
Mon, 14 Nov 2016 03:12:58 +0000 (04:12 +0100)
committerRobin Gareus <robin@gareus.org>
Mon, 14 Nov 2016 03:12:58 +0000 (04:12 +0100)
gtk2_ardour/selection.cc

index dce8d13a41a3e5366267fcd0bf9614bb8f78910a..5c93fd62c866f2ca3f07b7420cfb9f636872cba9 100644 (file)
@@ -1394,10 +1394,11 @@ Selection::set_state (XMLNode const & node, int)
                        XMLNodeList children = (*i)->children ();
 
                        for (XMLNodeList::const_iterator ci = children.begin(); ci != children.end(); ++ci) {
-                               XMLProperty const * prop_id = (*ci)->property (X_("id"));
-                               Evoral::event_id_t id = atoi(prop_id->value());
-
-                               notes.push_back (id);
+                               XMLProperty const* prop_id = (*ci)->property (X_("id"));
+                               if (prop_id) {
+                                       Evoral::event_id_t id = atoi (prop_id->value ());
+                                       notes.push_back (id);
+                               }
                        }
 
                        for (RegionSelection::iterator rsi = rs.begin(); rsi != rs.end(); ++rsi) {