From 24a09e381ade8b3d5e1bad3d53d7be52b3e40336 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 11 Oct 2021 17:56:56 -0600 Subject: [PATCH] triggerbox: don't fail/crash/assert if set_from_path() is called on an illegal slot --- libs/ardour/triggerbox.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc index 40a210a297..efc465896a 100644 --- a/libs/ardour/triggerbox.cc +++ b/libs/ardour/triggerbox.cc @@ -1032,7 +1032,9 @@ TriggerBox::get_next_trigger () int TriggerBox::set_from_path (uint64_t slot, std::string const & path) { - assert (slot < all_triggers.size()); + if (slot >= all_triggers.size()) { + return 0; + } try { SoundFileInfo info;