[code] Fixed selection bug in VariableBoxController.

Change-Id: I8fcbdd6e181453bb8fbee7b4efc8573ca112c6a2
This commit is contained in:
Léa Saviot
2017-12-04 10:44:35 +01:00
parent db35fc1d72
commit 277771c243

View File

@@ -85,6 +85,9 @@ bool VariableBoxController::ContentViewController::handleEvent(Ion::Events::Even
return true;
}
if (event == Ion::Events::OK || event == Ion::Events::EXE) {
if (m_selectableTableView.selectedRow() < 0 || m_selectableTableView.selectedRow() >= m_scriptNodesCount) {
return false;
}
ScriptNode selectedScriptNode = m_scriptNodes[m_selectableTableView.selectedRow()];
insertTextInCaller(selectedScriptNode.name());
if (selectedScriptNode.type() == ScriptNode::Type::Function) {