Skip to content
Snippets Groups Projects
Commit eb0e9d56 authored by sfan5's avatar sfan5
Browse files

Allow nothing to be selected from formspec parameters

parent 3a95054d
No related branches found
No related tags found
No related merge requests found
......@@ -565,10 +565,8 @@ void GUITable::setSelected(s32 index)
--index; // Switch from 1-based indexing to 0-based indexing
s32 rowcount = m_rows.size();
if (rowcount == 0) {
if (rowcount == 0 || index < 0) {
return;
} else if (index < 0) {
index = 0;
} else if (index >= rowcount) {
index = rowcount - 1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment