Protection against empty menus

This commit is contained in:
Bertrand Songis
2020-06-19 12:39:21 +02:00
parent 4f065ef1cb
commit 5053b702e1
+3 -1
View File
@@ -65,7 +65,9 @@ void MenuBody::onEvent(event_t event)
bool MenuBody::onTouchEnd(coord_t /*x*/, coord_t y)
{
int index = y / MENUS_LINE_HEIGHT;
lines[index].onPress();
if (index < lines.size()) {
lines[index].onPress();
}
getParent()->getParent()->deleteLater();
return true;
}