OSC: Fix potential crash on select-prev-route (#8670)
If the selection here is empty for whatever reason, it crashed with a null pointer dereference.
This commit is contained in:
parent
45bd2c47d8
commit
57a3db06f8
|
@ -79,7 +79,9 @@ CoreSelection::select_adjacent_stripable (bool mixer_order, bool routes_only,
|
|||
/* fetch the current selection so that we can get the most recently selected */
|
||||
StripableAutomationControls selected;
|
||||
get_stripables (selected);
|
||||
boost::shared_ptr<Stripable> last_selected = selected.back().stripable;
|
||||
boost::shared_ptr<Stripable> last_selected =
|
||||
selected.empty () ? boost::shared_ptr<Stripable> ()
|
||||
: selected.back ().stripable;
|
||||
|
||||
/* Get all stripables and sort into the appropriate ordering */
|
||||
StripableList stripables;
|
||||
|
|
Loading…
Reference in New Issue