[code] Fixed assertion bug in MenuController.

The assert should take into account the fact that there might not be any
script.

Change-Id: I68f0e5071ffd011fc5bb1dacc035d2127bdd8176
This commit is contained in:
Léa Saviot
2017-11-28 10:16:07 +01:00
parent 6ccd0c1c55
commit 2ce26f2625

View File

@@ -52,7 +52,7 @@ void MenuController::didBecomeFirstResponder() {
if (m_selectableTableView.selectedRow() < 0) {
m_selectableTableView.selectCellAtLocation(0,0);
}
assert(m_selectableTableView.selectedRow() < m_scriptStore->numberOfScripts());
assert(m_selectableTableView.selectedRow() < m_scriptStore->numberOfScripts() + 1);
app()->setFirstResponder(&m_selectableTableView);
}