Safeguard `stripable_list_to_control_list` API

See also 976e03c15c which does this for `route_list_to_control_list`.
Fix crashes with empty route-lists e.g. momentary solo which was
introduced in 03105aa760.
This commit is contained in:
Robin Gareus 2023-09-13 00:23:16 +02:00
parent 94b7ed8d4c
commit 810da43be6
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 1 additions and 0 deletions

View File

@ -137,6 +137,7 @@ template<typename T> std::shared_ptr<AutomationControlList> stripable_list_to_co
template<typename T> std::shared_ptr<AutomationControlList> stripable_list_to_control_list (std::shared_ptr<StripableList const> sl, std::shared_ptr<T> (Stripable::*get_control)() const) {
std::shared_ptr<AutomationControlList> cl (new AutomationControlList);
if (!sl) { return cl; }
for (auto const & s : *sl) {
std::shared_ptr<AutomationControl> ac = (s.get()->*get_control)();
if (ac) {