From 810da43be6fe6c0978606eef5336f76cdd68c7c8 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 13 Sep 2023 00:23:16 +0200 Subject: [PATCH] Safeguard `stripable_list_to_control_list` API See also 976e03c15cc which does this for `route_list_to_control_list`. Fix crashes with empty route-lists e.g. momentary solo which was introduced in 03105aa760. --- libs/ardour/ardour/utils.h | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/ardour/ardour/utils.h b/libs/ardour/ardour/utils.h index 37788b321e..0030ddead8 100644 --- a/libs/ardour/ardour/utils.h +++ b/libs/ardour/ardour/utils.h @@ -137,6 +137,7 @@ template std::shared_ptr stripable_list_to_co template std::shared_ptr stripable_list_to_control_list (std::shared_ptr sl, std::shared_ptr (Stripable::*get_control)() const) { std::shared_ptr cl (new AutomationControlList); + if (!sl) { return cl; } for (auto const & s : *sl) { std::shared_ptr ac = (s.get()->*get_control)(); if (ac) {