13
0

US2400 - fix crash when no strip is selected

first selected could be null, so check that first.
This is untested since I don't have a surface.
This commit is contained in:
Todd Naugle 2022-05-10 09:16:58 -05:00
parent 834ca29cde
commit be90b4e0ca

View File

@ -130,10 +130,13 @@ LedState
US2400Protocol::right_press (Button &)
{
if (_subview_mode != None) {
boost::shared_ptr<Stripable> s = first_selected_stripable();
if (s) {
bool hasNextSend = true;
int numSends = 0;
while (hasNextSend) {
if (first_selected_stripable()->send_name(numSends).length() < 1) {
if (s->send_name(numSends).length() < 1) {
hasNextSend = false;
} else {
numSends++;
@ -143,6 +146,7 @@ US2400Protocol::right_press (Button &)
_sends_bank++;
redisplay_subview_mode();
}
}
return none;
}